Fixed test to not download images when configured with a disk file path.
[snaps.git] / snaps / openstack / os_credentials.py
index c173bf7..072c00a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 Cable Television Laboratories, Inc. ("CableLabs")
+# Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs")
 #                    and others.  All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,9 +20,9 @@ class OSCreds:
     Represents the credentials required to connect with OpenStack servers
     """
 
-    def __init__(self, username, password, auth_url, project_name, identity_api_version=2, image_api_version=1,
+    def __init__(self, username, password, auth_url, project_name, identity_api_version=2, image_api_version=2,
                  network_api_version=2, compute_api_version=2, user_domain_id='default', project_domain_id='default',
-                 proxy_settings=None):
+                 interface="admin", proxy_settings=None, cacert=True):
         """
         Constructor
         :param username: The user (required)
@@ -35,7 +35,10 @@ class OSCreds:
         :param compute_api_version: The OpenStack's API version to use for Nova clients
         :param user_domain_id: Used for v3 APIs
         :param project_domain_id: Used for v3 APIs
+        :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
         """
         self.username = username
         self.password = password
@@ -47,7 +50,9 @@ class OSCreds:
         self.compute_api_version = compute_api_version
         self.user_domain_id = user_domain_id
         self.project_domain_id = project_domain_id
+        self.interface = interface
         self.proxy_settings = proxy_settings
+        self.cacert = cacert
 
         if self.proxy_settings and not isinstance(self.proxy_settings, ProxySettings):
             raise Exception('proxy_settings must be an instance of the class ProxySettings')
@@ -72,7 +77,9 @@ class OSCreds:
                ', network_api_version=' + str(self.network_api_version) + \
                ', compute_api_version=' + str(self.compute_api_version) + \
                ', user_domain_id=' + str(self.user_domain_id) + \
-               ', proxy_settings=' + str(self.proxy_settings)
+               ', interface=' + str(self.interface) + \
+               ', proxy_settings=' + str(self.proxy_settings) + \
+               ', cacert=' + str(self.cacert)
 
 
 class ProxySettings: