diff options
author | Dimitri Mazmanov <dimitri.mazmanov@ericsson.com> | 2016-07-28 11:27:13 +0200 |
---|---|---|
committer | Jose Lausuch <jose.lausuch@ericsson.com> | 2016-07-28 11:03:50 +0000 |
commit | eee36c744f0c40b1da7009a24784142f4e8b6ba5 (patch) | |
tree | c091e21ddb32927b01de99e1b055a4e83edc7829 /utils/openstack_utils.py | |
parent | 4f9781e7970e8f22ba6a29ae2a5448f289af1696 (diff) |
Add region name to OpenStack credentials
Currently functest doesn't account for regions when it tries to
instantieate OpenStack clients. As a result, the code fails when
functest is used in a multi-region environment.
The fix forces functest account for region name.
Signed-off-by: Dimitri Mazmanov <dimitri.mazmanov@ericsson.com>
Change-Id: Iebbd20042548c02da9d5ed7e58a454347a555778
Diffstat (limited to 'utils/openstack_utils.py')
-rwxr-xr-x[-rw-r--r--] | utils/openstack_utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/openstack_utils.py b/utils/openstack_utils.py index 75f06046a..8e3272b8a 100644..100755 --- a/utils/openstack_utils.py +++ b/utils/openstack_utils.py @@ -74,6 +74,10 @@ def get_credentials(service): creds.update({ "endpoint_type": os.environ.get("OS_ENDPOINT_TYPE") }) + if os.getenv('OS_REGION_NAME') is not None: + creds.update({ + "region_name": os.environ.get("OS_REGION_NAME") + }) cacert = os.environ.get("OS_CACERT") if cacert is not None: # each openstack client uses differnt kwargs for this |