summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/os_credentials.py
diff options
context:
space:
mode:
authorLinda Wang <wangwulin@huawei.com>2017-06-24 07:42:20 +0000
committerLinda Wang <wangwulin@huawei.com>2017-06-27 07:58:19 +0000
commit00f3d66bc9af0292b6ab2433eb2a6e1de8467300 (patch)
tree233d9941c353acc64600ed8bdb945730b4157b0f /snaps/openstack/os_credentials.py
parentc7ba89444d160cb81656a49cb93416ee5013aa8f (diff)
Enable snaps work using public endpoint
When functest is not run on jumpserver but on other external host without admin network, snaps failed to connect the admin endpoint. So running snaps tests using public endpoint should be allowed. JIRA: SNAPS-110 Change-Id: I8ca8d8c48330b5f427568d3d5fe942f6f2ca9ea9 Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'snaps/openstack/os_credentials.py')
-rw-r--r--snaps/openstack/os_credentials.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/snaps/openstack/os_credentials.py b/snaps/openstack/os_credentials.py
index b55e480..072c00a 100644
--- a/snaps/openstack/os_credentials.py
+++ b/snaps/openstack/os_credentials.py
@@ -22,7 +22,7 @@ class OSCreds:
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, cacert=True):
+ interface="admin", proxy_settings=None, cacert=True):
"""
Constructor
:param username: The user (required)
@@ -35,6 +35,7 @@ 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
@@ -49,6 +50,7 @@ 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
@@ -75,6 +77,7 @@ 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) + \
+ ', interface=' + str(self.interface) + \
', proxy_settings=' + str(self.proxy_settings) + \
', cacert=' + str(self.cacert)