X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=snaps%2Fopenstack%2Fos_credentials.py;h=255341091fe69765ce7c9fbf37d152dc2d8d941c;hb=b59094ae4f53e0da4e4a5fb7c2aece3647d23b8d;hp=bb68215dff572ca667340c070c20213756df1b1e;hpb=430905e7f76e4a074167a49ca2bfbf727eebcefd;p=snaps.git diff --git a/snaps/openstack/os_credentials.py b/snaps/openstack/os_credentials.py index bb68215..2553410 100644 --- a/snaps/openstack/os_credentials.py +++ b/snaps/openstack/os_credentials.py @@ -15,7 +15,7 @@ from neutronclient.common.utils import str2bool import numbers from snaps import file_utils -from snaps.openstack.utils import glance_utils, keystone_utils +from snaps.openstack.utils import glance_utils, keystone_utils, cinder_utils __author__ = 'spisarski' @@ -42,6 +42,10 @@ class OSCreds: clients :param heat_api_version: The OpenStack's API version to use for Heat 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') @@ -49,10 +53,8 @@ class OSCreds: :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') @@ -85,6 +87,16 @@ class OSCreds: else: self.heat_api_version = float(kwargs['heat_api_version']) + 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']) + + 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') if kwargs.get('user_domain_name') is None: @@ -100,7 +112,7 @@ class OSCreds: self.project_domain_name = kwargs['project_domain_name'] if kwargs.get('interface') is None: - self.interface = 'admin' + self.interface = 'public' else: self.interface = kwargs['interface'] @@ -192,7 +204,6 @@ class ProxySettings: :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')