From b37d3c78b2b7f1822dc6784c2ee5860d6bea6a5e Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 21 Feb 2018 16:03:50 +0100 Subject: Leverage of snaps creds to get the right region name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Else it gets the defaut value as it's unset in env. Change-Id: Ic2a9cdaed7891fe2723f960782c81c0cbb04e8f0 Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/vnf/epc/juju_epc.py | 9 ++------- 1 file 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) -- cgit 1.2.3-korg