The freezer.openstack.osclients Module

class freezer.openstack.osclients.DryRunSwiftclientConnectionWrapper(sw_connector)[source]

Bases: object

dummy(*args, **kwargs)[source]
class freezer.openstack.osclients.OSClientManager(auth_url, auth_method='password', **kwargs)[source]

Bases: object

clean_snapshot(snapshot)[source]

Deletes snapshot :param snapshot: snapshot name

create_cinder()[source]

Use pre-initialized session to create an instance of cinder client. :return: cinderclient instance

create_glance()[source]

Use pre-initialized session to create an instance of glance client. :return: glanceclient instance

create_image(name, container_format, disk_format, data=None)[source]
create_nova()[source]

Use pre-initialized session to create an instance of nova client. :return: novaclient instance

create_swift()[source]

Swift client needs to be treated differently so we need to copy the arguments and provide it to swiftclient the correct way ! :return: swiftclient instance

do_copy_volume(snapshot)[source]

Creates new volume from a snapshot :param snapshot: provided snapshot :return: created volume

download_image(image)[source]

Creates a stream for image data :param image: Image object for downloading :return: stream of image data

get_cinder()[source]

Get cinderclient instance :return: cinderclient instance

get_glance()[source]

Get glanceclient instance :return: glanceclient instance

get_nova()[source]

Get novaclient instance :return: novaclient instance

get_swift()[source]

Get swiftclient instance :return: swiftclient instance

make_glance_image(image_volume_name, copy_volume)[source]

Creates an glance image from volume :param image_volume_name: Name of image :param copy_volume: volume to make an image :return: Glance image object

provide_snapshot(volume, snapshot_name)[source]

Creates snapshot for cinder volume with –force parameter :param volume: volume object for snapshoting :param snapshot_name: name of snapshot :return: snapshot object

class freezer.openstack.osclients.OpenstackOpts(auth_url, auth_method='password', auth_version=None, username=None, password=None, region_name=None, cacert=None, identity_api_version=None, project_id=None, project_name=None, tenant_id=None, tenant_name=None, token=None, insecure=False, endpoint_type='internalURL', interface=None, compute_api_version=2, image_api_version=2, volume_api_version=2, user_domain_name=None, domain_id=None, user_domain_id=None, project_domain_id=None, domain_name=None, project_domain_name=None)[source]

Bases: object

Gathering and maintaining the right Openstack credentials that will be used to authenticate against keystone. Now we support keystone v2 and v3. We need to provide a correct url that ends with either v2.0 or v3 or provide auth_version or identity_api_version

static create_from_dict(src_dict)[source]

Load Openstack arguments from dict and return OpenstackOpts object with the correct parameters to authenticate. :param src_dict: dict :return: OpenstackOpts object with the passed arguments in place

static create_from_env()[source]

Parse environment variables and load Openstack related options. :return:

get_opts_dicts()[source]

Return opentack auth arguments as dict detects the auth version from url if not provided handles certificate issues