teuthology.provision.cloud package


teuthology.provision.cloud.base module

class teuthology.provision.cloud.base.Provider(name, conf)

Bases: object

property driver
class teuthology.provision.cloud.base.Provisioner(provider, name, os_type=None, os_version=None, conf=None, user='ubuntu')

Bases: object

property remote

teuthology.provision.cloud.openstack module

class teuthology.provision.cloud.openstack.OpenStackProvider(name, conf)

Bases: teuthology.provision.cloud.base.Provider

property default_userdata
property driver
property images
property networks
property security_groups
property sizes
property ssh_interface
class teuthology.provision.cloud.openstack.OpenStackProvisioner(provider, name, os_type=None, os_version=None, conf=None, user='ubuntu')

Bases: teuthology.provision.cloud.base.Provisioner

defaults = {'openstack': {'machine': {'cpus': 1, 'disk': 20, 'ram': 8000}, 'volumes': {'count': 0, 'size': 0}}}
property image
property node
property security_groups
property size
property userdata
teuthology.provision.cloud.openstack.retry(function, *args, **kwargs)

Call a function (returning its results), retrying if any of the exceptions in RETRY_EXCEPTIONS are raised

teuthology.provision.cloud.util module

class teuthology.provision.cloud.util.AuthToken(name, directory='/home/jenkins-build/.cache/')

Bases: object

property expired
time_format = '%Y-%m-%d %H:%M:%S%z'
write(value, expires, endpoint)
teuthology.provision.cloud.util.combine_dicts(list_of_dicts, func)

A useful function to merge a list of dicts. Most of the work is done by selective_update().

  • list_of_dicts – A list of dicts to combine using selective_update()

  • func – A comparison function that will be passed to selective_update() along with values from each input dict


The new, merged, dict

teuthology.provision.cloud.util.selective_update(a, b, func)

Given two dicts and a comparison function, recursively inspects key-value pairs in the second dict and merges them into the first dict if func() returns a “Truthy” value.


>>> a = dict(x=0, y=1, z=3)
>>> b = dict(x=1, y=2, z=0)
>>> selective_update(a, b, lambda foo, bar: foo > bar)
>>> print(a)
{'x': 1, 'y': 2, 'z': 3}
  • a – A dict. This is modified in-place!

  • b – Another dict.

  • func – A binary comparison function that will be called similarly to: func(a[key], b[key]) for each key in b.

Module contents

teuthology.provision.cloud.get_provisioner(node_type, name, os_type, os_version, conf=None)