clients
:param volume_api_version: The OpenStack's API version to use
for Cinder clients
+ :param magnum_api_version: The OpenStack's API version to use
+ for magnum clients
:param user_domain_id: Used for v3 APIs (default='default')
:param user_domain_name: Used for v3 APIs (default='Default')
:param project_domain_id: Used for v3 APIs (default='default')
:param interface: Used to specify the endpoint type for keystone as
public, admin, internal
:param proxy_settings: instance of os_credentials.ProxySettings class
- :param cacert: Default to be True for http, or the certification file
- is specified for https verification, or set to be False
- to disable server certificate verification without cert
- file
+ :param cacert: True for https or the certification file for https
+ verification (default=False)
:param region_name: the region (optional default = None)
"""
self.username = kwargs.get('username')
self.project_name = kwargs.get('project_name')
if kwargs.get('identity_api_version') is None:
- self.identity_api_version = keystone_utils.V2_VERSION_NUM
+ self.identity_api_version = keystone_utils.V3_VERSION_NUM
else:
self.identity_api_version = float(kwargs['identity_api_version'])
if kwargs.get('heat_api_version') is None:
self.heat_api_version = 1
else:
- self.heat_api_version = float(kwargs['heat_api_version'])
+ val = kwargs['heat_api_version']
+ ver = float(val)
+ self.heat_api_version = int(ver)
if kwargs.get('volume_api_version') is None:
self.volume_api_version = cinder_utils.VERSION_2
else:
- self.volume_api_version = float(
- kwargs['volume_api_version'])
+ self.volume_api_version = float(kwargs['volume_api_version'])
+
+ if kwargs.get('magnum_api_version') is None:
+ self.magnum_api_version = 1
+ else:
+ self.magnum_api_version = float(kwargs['magnum_api_version'])
self.user_domain_id = kwargs.get('user_domain_id', 'default')
return new_url
- @property
+ def to_dict(self):
+ """Converts object to a dict that can be used to construct another"""
+ return {'username': self.username,
+ 'password': self.password,
+ 'auth_url': self.auth_url,
+ 'project_name': self.project_name,
+ 'identity_api_version': self.identity_api_version,
+ 'image_api_version': self.image_api_version,
+ 'network_api_version': self.network_api_version,
+ 'compute_api_version': self.compute_api_version,
+ 'heat_api_version': self.heat_api_version,
+ 'user_domain_id': self.user_domain_id,
+ 'user_domain_name': self.user_domain_name,
+ 'project_domain_id': self.project_domain_id,
+ 'project_domain_name': self.project_domain_name,
+ 'interface': self.interface,
+ 'region_name': self.region_name,
+ 'proxy_settings': self.proxy_settings,
+ 'cacert': self.cacert}
+
+ def __eq__(self, other):
+ return (self.username == other.username and
+ self.password == other.password and
+ self.auth_url == other.auth_url and
+ self.project_name == other.project_name and
+ float(self.identity_api_version) == float(other.identity_api_version) and
+ float(self.image_api_version) == float(other.image_api_version) and
+ float(self.network_api_version) == float(other.network_api_version) and
+ float(self.compute_api_version) == float(other.compute_api_version) and
+ float(self.heat_api_version) == float(other.heat_api_version) and
+ self.user_domain_id == other.user_domain_id and
+ self.user_domain_name == other.user_domain_name and
+ self.project_domain_id == other.project_domain_id and
+ self.project_domain_name == other.project_domain_name and
+ self.interface == other.interface and
+ self.region_name == other.region_name and
+ self.proxy_settings == other.proxy_settings and
+ self.cacert == other.cacert)
+
def __str__(self):
"""Converts object to a string"""
return ('OSCreds - username=' + str(self.username) +
:param port: the HTTP proxy port
:param https_host: the HTTPS proxy host (defaults to host)
:param https_port: the HTTPS proxy port (defaults to port)
- :param port: the HTTP proxy port
:param ssh_proxy_cmd: the SSH proxy command string (optional)
"""
self.host = kwargs.get('host')