teuthology.provision.cloud package

Submodules

teuthology.provision.cloud.base module

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

Bases: object

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

Bases: object

create()
destroy()
remote

teuthology.provision.cloud.openstack module

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

Bases: teuthology.provision.cloud.base.Provider

driver
images
networks
security_groups
sizes
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}}}
image
node
security_groups
size
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

expired
read()
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().

Parameters:
  • 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
Returns:

The new, merged, dict

teuthology.provision.cloud.util.get_user_ssh_pubkey(path='~/.ssh/id_rsa.pub')
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.

Example:

>>> 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}
Parameters:
  • 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_provider(node_type)
teuthology.provision.cloud.get_provider_conf(node_type)
teuthology.provision.cloud.get_provisioner(node_type, name, os_type, os_version, conf=None)
teuthology.provision.cloud.get_types()