aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--functest/opnfv_tests/openstack/tempest/conf_utils.py4
-rw-r--r--functest/opnfv_tests/vnf/epc/juju_epc.py8
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.py3
-rw-r--r--functest/opnfv_tests/vnf/router/cloudify_vrouter.py3
4 files changed, 11 insertions, 7 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index d62f3daa0..88ad3b2d9 100644
--- a/functest/opnfv_tests/openstack/tempest/conf_utils.py
+++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py
@@ -207,8 +207,8 @@ def configure_tempest_update_params(
# enable multinode tests
rconfig.set('compute', 'min_compute_nodes', compute_cnt)
rconfig.set('compute-feature-enabled', 'live_migration', True)
-
- rconfig.set('identity', 'region', os.environ.get('OS_REGION_NAME'))
+ if os.environ.get('OS_REGION_NAME'):
+ rconfig.set('identity', 'region', os.environ.get('OS_REGION_NAME'))
identity_api_version = os.environ.get("OS_IDENTITY_API_VERSION", '3')
if identity_api_version == '3':
auth_version = 'v3'
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)
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
index 4ac79b55d..786c535ed 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
@@ -250,7 +250,8 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
keystone_password=snaps_creds.password,
keystone_tenant_name=snaps_creds.project_name,
keystone_url=public_auth_url,
- region=snaps_creds.region_name,
+ region=snaps_creds.region_name if snaps_creds.region_name else (
+ 'RegionOne'),
user_domain_name=snaps_creds.user_domain_name,
project_domain_name=snaps_creds.project_domain_name)
self.__logger.info("Set creds for cloudify manager %s", cfy_creds)
diff --git a/functest/opnfv_tests/vnf/router/cloudify_vrouter.py b/functest/opnfv_tests/vnf/router/cloudify_vrouter.py
index a88200339..e56f23cfc 100644
--- a/functest/opnfv_tests/vnf/router/cloudify_vrouter.py
+++ b/functest/opnfv_tests/vnf/router/cloudify_vrouter.py
@@ -335,7 +335,8 @@ class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase):
self.vnf['inputs'].update(dict(
keystone_project_domain_name=snaps_creds.project_domain_name))
self.vnf['inputs'].update(dict(
- region=snaps_creds.region_name))
+ region=snaps_creds.region_name if snaps_creds.region_name else (
+ 'RegionOne')))
self.vnf['inputs'].update(dict(
keystone_url=keystone_utils.get_endpoint(
snaps_creds, 'identity')))