cfme.utils.trackerbot module

class cfme.utils.trackerbot.Group(name, stream=True, active=True)[source]

Bases: dict

dict subclass to help serialize groups as JSON

class cfme.utils.trackerbot.Provider(key)[source]

Bases: dict

dict subclass to help serialize providers as JSON

class cfme.utils.trackerbot.ProviderTemplate(provider, template, usable=None, tested=None)[source]

Bases: dict

dict subclass to help serialize providertemplate details as JSON

class cfme.utils.trackerbot.Template(name, group=None, datestamp=None, custom_data=None)[source]

Bases: dict

dict subclass to help serialize templates as JSON

class cfme.utils.trackerbot.TemplateInfo(group_name, datestamp, stream)

Bases: tuple


Return self as a plain tuple. Used by copy and pickle.


Exclude the OrderedDict from pickling


Return a nicely formatted representation string


Alias for field number 1


Alias for field number 0


Alias for field number 2

class cfme.utils.trackerbot.TemplateName(build_url)[source]

Bases: object

Generate a template name from given link, a timestamp, and optional version string

This method should handle naming templates from the following URL types:

  • http://<build-server-address>/builds/manageiq/master/latest/
  • http://<build-server-address>/builds/manageiq/gaprindashvili/stable/
  • http://<build-server-address>/builds/manageiq/fine/stable/
  • http://<build-server-address>/builds/cfme/5.8/stable/
  • http://<build-server-address>/builds/cfme/5.9/latest/

These builds fall into a few categories:

  • MIQ nightly (master/latest) (upstream)
  • MIQ stable (<name>/stable) (upstream_stable, upstream_fine, etc)
  • CFME nightly (<stream>/latest) (downstream-nightly)
  • CFME stream (<stream>/stable) (downstream-<stream>)

The generated template names should follow the syntax with 5 digit version numbers:

  • MIQ nightly: miq-nightly-<yyyymmdd> (miq-nightly-201711212330)
  • MIQ stable: miq-<name>-<number>-yyyymmdd (miq-fine-4-20171024, miq-gapri-20180130)
  • CFME nightly: cfme-nightly-<version>-<yyyymmdd> (cfme-nightly-59000-20170901)
  • CFME stream: cfme-<version>-<yyyymmdd> (cfme-57402-20171202)

Release names for upstream will be truncated to 5 letters (thanks gaprindashvili...)

CFME_ID = 'cfme'
MIQ_ID = 'manageiq'

Automatically created by attrs.


Automatically created by attrs.


Automatically created by attrs.


Automatically created by attrs.


Check equality and either forward a NotImplemented or return the result negated.


Automatically created by attrs.


Get a build date from the SHA256SUM


Version string from version file in build folder (cfme) release name and build number from an image file (MIQ)

Will substitute ‘nightly’ for master URLs

Raises:ValueError if unable to parse version string or release name from files
Returns:String 5-digit version number or release name for MIQ

Actually construct the template name

cfme.utils.trackerbot.active_streams(api, force=False)[source]

Return an API object authenticated to the given trackerbot api

cfme.utils.trackerbot.check_if_tested(api, template_name, provider_type)[source]

Check if a template has been tested on a specific provider type.

  • template_name – e.g. “cfme-59021-02141929”
  • provider_type – e.g. “rhevm”

True if this template has been tested on at least one deployment of this provider type False otherwise


Get a parser with basic trackerbot configuration params already set up

It will use the following keys from the env conf if they’re available:

# with example values
    url: http://hostname/api/
    username: username
    apikey: 0123456789abcdef
cfme.utils.trackerbot.composite_uncollect(build, source='jenkins')[source]

Composite build function

cfme.utils.trackerbot.delete_provider_template(api, provider, template)[source]

Delete a provider/template relationship, used when a template is removed from one provider

cfme.utils.trackerbot.depaginate(api, result)[source]

Depaginate the first (or only) page of a paginated result


Given a date object, return a date object that isn’t from the future

Some templates only have month/day values, not years. We create a date object

cfme.utils.trackerbot.get_tested_providers(api, template_name)[source]

Return all tested provider templates for given template_name

cfme.utils.trackerbot.latest_template(api, group, provider_key=None)[source]
cfme.utils.trackerbot.mark_provider_template(api, provider, template, tested=None, usable=None, diagnosis='', build_number=None, stream=None, custom_data=None)[source]

Mark a provider template as tested and/or usable

  • api – The trackerbot API to act on
  • provider – The provider’s key in cfme_data or a Provider instance
  • template – The name of the template to mark on this provider or a Template
  • tested – Whether or not this template has been tested on this provider
  • usable – Whether or not this template is usable on this provider
  • diagnosis – Optional reason for marking a template

Returns the response of the API request

cfme.utils.trackerbot.mark_unusable_as_untested(api, template_name, provider_type)[source]

Search through all tested providers and if provider type is unusable, mark it as not tested

This action is limited to a specific template_name and a specific provider_type


Given a template name, attempt to extract its group name and upload date

  • None if no groups matched
  • group_name, datestamp of the first matching group. group name will be a string, datestamp with be a, or None if a date can’t be derived from the template name
cfme.utils.trackerbot.post_jenkins_result(job_name, number, stream, date, template, build_status, artifact_report)[source]
cfme.utils.trackerbot.post_task_result(tid, result, output=None, coverage=0.0)[source]
cfme.utils.trackerbot.set_provider_active(api, provider, active=True)[source]

Set a provider active (or inactive)

  • api – The trackerbot API to act on
  • active – active flag to set on the provider (True or False)
cfme.utils.trackerbot.templates_to_test(api, limit=1, request_type=None)[source]

get untested templates to pass to jenkins

  • limit – max number of templates to pull per request
  • request_type – request the provider_key of specific type
  • openstack (e.g) –
cfme.utils.trackerbot.trackerbot_add_provider_template(stream, provider, template_name, custom_data=None)[source]