From: Dimitri Mazmanov Date: Thu, 28 Jul 2016 09:27:13 +0000 (+0200) Subject: Add region name to OpenStack credentials X-Git-Tag: 0.2~1353 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=eee36c744f0c40b1da7009a24784142f4e8b6ba5;p=functest-xtesting.git 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 Change-Id: Iebbd20042548c02da9d5ed7e58a454347a555778 --- diff --git a/utils/openstack_utils.py b/utils/openstack_utils.py old mode 100644 new mode 100755 index 75f06046..8e3272b8 --- 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