diff options
author | mrichomme <morgan.richomme@orange.com> | 2020-10-13 12:52:24 +0200 |
---|---|---|
committer | mrichomme <morgan.richomme@orange.com> | 2020-10-14 11:27:35 +0200 |
commit | b7b9796d16a2e53e0e58ae9888dade1e89a0cc19 (patch) | |
tree | 379944906ed2c5a837dc1e09810235fd03a37e8b /src/onaptests/configuration/clearwater_ims_nomulticloud_settings.py | |
parent | 6276bed4df9b8458c4b6805edab81652fb15de76 (diff) |
Improve xtesting integration
All the exceptions shall be caught by the use case
Issue-ID: TEST-257
Signed-off-by: mrichomme <morgan.richomme@orange.com>
Change-Id: Ie2762ad869d8984ce2125db4a8ef4990ee50f82a
Signed-off-by: mrichomme <morgan.richomme@orange.com>
Diffstat (limited to 'src/onaptests/configuration/clearwater_ims_nomulticloud_settings.py')
-rw-r--r-- | src/onaptests/configuration/clearwater_ims_nomulticloud_settings.py | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/src/onaptests/configuration/clearwater_ims_nomulticloud_settings.py b/src/onaptests/configuration/clearwater_ims_nomulticloud_settings.py index 0b13762..1a1cb3c 100644 --- a/src/onaptests/configuration/clearwater_ims_nomulticloud_settings.py +++ b/src/onaptests/configuration/clearwater_ims_nomulticloud_settings.py @@ -31,7 +31,6 @@ try: SERVICE_NAME = next(iter(yaml_config_file.keys())) except ValueError: SERVICE_NAME = "" # Fill me - VSP_FILE_PATH = "" # Fill me CLOUD_REGION_CLOUD_OWNER = "clearwater-ims-cloud-owner" CLOUD_REGION_TYPE = "openstack" @@ -55,26 +54,11 @@ SERVICE_INSTANCE_NAME = "clearwater-ims_service_instance" # Assuming a cloud.yaml is available, use the openstack client # to retrieve cloud info and avoid data duplication TEST_CLOUD = os.getenv('OS_TEST_CLOUD') -try: - if TEST_CLOUD is not None: - cloud = openstack.connect(cloud=TEST_CLOUD) - VIM_USERNAME = cloud.config.auth['username'] - VIM_PASSWORD = cloud.config.auth['password'] - VIM_SERVICE_URL = cloud.config.auth['auth_url'] - TENANT_ID = cloud.config.auth['project_id'] - TENANT_NAME = cloud.config.auth['project_name'] - CLOUD_REGION_ID = cloud.config.region_name - CLOUD_DOMAIN = cloud.config.auth['project_domain_name'] - else: - raise KeyError -except KeyError: - # If you do not use the cloud.yaml as imput for your openstack - # put the input data here - # Note if 1 parameter is missing in the clouds.yaml, we fallback here - TENANT_ID = "" # Fill me - TENANT_NAME = "" # Fill me - VIM_USERNAME = "" # Fill me - VIM_PASSWORD = "" # Fill me - VIM_SERVICE_URL = "" # Fill me - CLOUD_REGION_ID = "RegionOne" # Update me if needed - CLOUD_DOMAIN = "Default" # Update me if needed +cloud = openstack.connect(cloud=TEST_CLOUD) +VIM_USERNAME = cloud.config.auth.get('username','Fill me') +VIM_PASSWORD = cloud.config.auth.get('password','Fill me') +VIM_SERVICE_URL = cloud.config.auth.get('auth_url','Fill me') +TENANT_ID = cloud.config.auth.get('project_id','Fill me') +TENANT_NAME = cloud.config.auth.get('project_name','Fill me') +CLOUD_REGION_ID = cloud.config.get('region_name','RegionOne') +CLOUD_DOMAIN = cloud.config.auth.get('project_domain_name','Default') |