bodhi_utils.py

This module's documentation was autogenerated

bodhi_utils._is_bodhi_testresult_needed(old_result, comment_time, result, time_span)[source]

This method's documentation was written by hand

This is an internal method for checking if posting test results to bodhi is really needed or not. You probably shouldn’t be using this but it was a good example of being able to add extra documentation to the generated docs.

bodhi_utils.bodhi_already_commented(update, testname, arch)[source]

Check if AutoQA comment is already posted.

Args: update – Bodhi update object –or– update title –or– update ID –or– package NVR testname – the name of the test arch – tested architecture

Note: Only NVR allowed, not ENVR. See https://fedorahosted.org/bodhi/ticket/592.

Returns: Tuple containing old result and time when the last comment was posted. If no comment is posted yet, or it is, but the update has been modified since, tuple will contain two empty strings.

Throws: ValueError – if no such update can be found

bodhi_utils.bodhi_list(params, limit=100)[source]

Perform a bodhi ‘list’ method call, with pagination handling. This method accepts more search params than the standard ‘query’ method.

Args: params – dictionary of params that will be passed to the ‘list’ method call.

E.g.: {‘package’:’foo-1.1.fc14’}

limit – the maximum number of results returned

Returns: List of update objects matching criteria

bodhi_utils.bodhi_post_testresult(update, testname, result, url, arch='noarch', karma=0)[source]

Post comment and karma to bodhi

Args: update – the title of the update comment on testname – the name of the test result – the result of the test url – url of the result of the test arch – tested architecture (default ‘noarch’) karma – karma points (default 0)

Returns: True if comment was posted successfully or comment wasn’t meant to be posted (either posting is turned off or comment was already posted), False otherwise.

bodhi_utils.bodhitime(timestamp)[source]

Convert timestamp (seconds since Epoch, assumed to be local time) to a Bodhi-approved time string (‘%Y-%m-%d %H:%M:%S’)

bodhi_utils.build2update(builds, strict=False)[source]

Find matching Bodhi updates for provided builds.

@param builds builds to search for; iterable of strings @param strict if False, incomplete Bodhi updates are allowed.

if True, every Bodhi update will be compared with the set of provided builds. If there is an Bodhi update which contains builds not provided in @param builds, that update is marked as incomplete and removed from the result - i.e. all builds from @param builds that were part of this incomplete update are placed in the second dictionary of the result tuple.
@return tuple of two dictionaries:
  • The first dict provides mapping between builds and their updates where no error occured. {build (string): Bodhi update (Bunch)}
  • The second dict provides mapping between builds and their updates where some error occured. {build (string): Bodhi update (Bunch) or None} The value is None if the matching Bodhi update could not be found (the only possible cause of failure if @param strict=False). Or the value is a Bodhi update that was incomplete (happens only if @param strict=True).
bodhi_utils.parse_bodhitime(bodhitimestr)[source]

Convert a Bodhi-approved time string (‘%Y-%m-%d %H:%M:%S’) to a float-represented number of seconds since Epoch (local time)

bodhi_utils.query_update(package)[source]

Get the last Bodhi update matching criteria.

Args: package – package NVR –or– package name –or– update title –or– update ID

Note: Only NVR allowed, not ENVR. See https://fedorahosted.org/bodhi/ticket/592.

Returns: Most recent Bodhi update object matching criteria, or None if no such available.

Indices and tables

Table Of Contents

This Page