aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf/epc
diff options
context:
space:
mode:
authorCédric Ollivier <ollivier.cedric@gmail.com>2018-07-09 22:39:42 +0200
committerCédric Ollivier <ollivier.cedric@gmail.com>2018-07-10 13:53:53 +0200
commit8b2f524f0f17f06bf1de02e0165230bad218132b (patch)
tree13be55076e9159d12baaff581df37922101ec87f /functest/opnfv_tests/vnf/epc
parent036cb7d9075f7eee45e7533d8c37a5b89e6c6dd5 (diff)
Force region to RegionOne if OS_REGION_NAME is unset
tempest still selects the first one if unset [1]. JIRA: FUNCTEST-990 [1] https://docs.openstack.org/tempest/latest/sampleconf.html Change-Id: I238d47173c2c4aa1db694028e4d44b80b0e280f1 Signed-off-by: Cédric Ollivier <ollivier.cedric@gmail.com>
Diffstat (limited to 'functest/opnfv_tests/vnf/epc')
-rw-r--r--functest/opnfv_tests/vnf/epc/juju_epc.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/functest/opnfv_tests/vnf/epc/juju_epc.py b/functest/opnfv_tests/vnf/epc/juju_epc.py
index 12c6d2398..3f2a9ff93 100644
--- a/functest/opnfv_tests/vnf/epc/juju_epc.py
+++ b/functest/opnfv_tests/vnf/epc/juju_epc.py
@@ -149,7 +149,8 @@ class JujuEpc(vnf.VnfOnBoarding):
clouds_yaml = os.path.join(self.res_dir, "clouds.yaml")
cloud_data = {
'url': self.public_auth_url,
- 'region': self.snaps_creds.region_name}
+ 'region': self.snaps_creds.region_name if (
+ self.snaps_creds.region_name) else 'RegionOne'}
with open(clouds_yaml, 'w') as yfile:
yfile.write(CLOUD_TEMPLATE.format(**cloud_data))
cmd = ['juju', 'add-cloud', 'abot-epc', '-f', clouds_yaml, '--replace']
@@ -303,8 +304,9 @@ class JujuEpc(vnf.VnfOnBoarding):
image_file=image_file))
image_id = image_creator.create().id
cmd = ['juju', 'metadata', 'generate-image', '-d', '/root',
- '-i', image_id, '-s', image_name,
- '-r', self.snaps_creds.region_name,
+ '-i', image_id, '-s', image_name, '-r',
+ self.snaps_creds.region_name if (
+ self.snaps_creds.region_name) else 'RegionOne',
'-u', self.public_auth_url]
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
self.__logger.info("%s\n%s", " ".join(cmd), output)