openstack: nova_utils_tests: Increase timeout for API calls
[snaps.git] / snaps / openstack / os_credentials.py
index bb68215..72223e3 100644 (file)
@@ -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']
 
@@ -157,7 +169,6 @@ class OSCreds:
 
         return new_url
 
-    @property
     def __str__(self):
         """Converts object to a string"""
         return ('OSCreds - username=' + str(self.username) +
@@ -192,7 +203,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')