summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-02-21 16:03:50 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-02-21 16:05:12 +0100
commitb37d3c78b2b7f1822dc6784c2ee5860d6bea6a5e (patch)
treed00756155a644bd51189e0f93f4c3c96cc9d1141
parent8ca868e6a71520d151a405f01e4a5a77973b4956 (diff)
Leverage of snaps creds to get the right region name
Else it gets the defaut value as it's unset in env. Change-Id: Ic2a9cdaed7891fe2723f960782c81c0cbb04e8f0 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r--functest/opnfv_tests/vnf/epc/juju_epc.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/functest/opnfv_tests/vnf/epc/juju_epc.py b/functest/opnfv_tests/vnf/epc/juju_epc.py
index dc92bc920..7d7194cdb 100644
--- a/functest/opnfv_tests/vnf/epc/juju_epc.py
+++ b/functest/opnfv_tests/vnf/epc/juju_epc.py
@@ -79,8 +79,6 @@ class JujuEpc(vnf.VnfOnBoarding):
__logger = logging.getLogger(__name__)
- default_region_name = "RegionOne"
-
def __init__(self, **kwargs):
if "case_name" not in kwargs:
kwargs["case_name"] = "juju_epc"
@@ -142,8 +140,7 @@ class JujuEpc(vnf.VnfOnBoarding):
clouds_yaml = os.path.join(self.res_dir, "clouds.yaml")
cloud_data = {
'url': self.public_auth_url,
- 'region': os.environ.get(
- "OS_REGION_NAME", self.default_region_name)}
+ 'region': self.snaps_creds.region_name}
with open(clouds_yaml, 'w') as yfile:
yfile.write(CLOUD_TEMPLATE.format(**cloud_data))
if os.system(
@@ -278,9 +275,7 @@ class JujuEpc(vnf.VnfOnBoarding):
os.system(
'juju metadata generate-image -d ~ -i {} -s {} -r '
'{} -u {}'.format(
- image_id, image_name,
- os.environ.get(
- "OS_REGION_NAME", self.default_region_name),
+ image_id, image_name, self.snaps_creds.region_name,
self.public_auth_url))
self.created_object.append(image_creator)
self.__logger.info("Network ID : %s", net_id)