aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/configuration/ubuntu16_nomulticloud_settings.py
diff options
context:
space:
mode:
authormrichomme <morgan.richomme@orange.com>2020-09-29 16:08:46 +0200
committermrichomme <morgan.richomme@orange.com>2020-09-29 16:36:40 +0200
commit3e390f1d45785bca5beb1f5c2fa57ef59f6736e9 (patch)
treec39f0a993fa5e609aeb3303189e3f55b8fcd82b3 /src/onaptests/configuration/ubuntu16_nomulticloud_settings.py
parent7d24eda2deefdc9b1f6dc1555f45573d4b2e2873 (diff)
Update path management
In case a yaml file is defined the zip was referenced in 2 places consider only the yaml param if the yaml file is defined Add the python path to simplify the integration in CI a,d avoid overwritting any configuration only the 2 ENV parameters + the openstack cloud + the hosts are needed to run any pythonsdk-test Issue-ID: TEST-240 Signed-off-by: mrichomme <morgan.richomme@orange.com> Change-Id: I57bf303b497e4d2b1dd740286f07beb3783222b1 Signed-off-by: mrichomme <morgan.richomme@orange.com>
Diffstat (limited to 'src/onaptests/configuration/ubuntu16_nomulticloud_settings.py')
-rw-r--r--src/onaptests/configuration/ubuntu16_nomulticloud_settings.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/onaptests/configuration/ubuntu16_nomulticloud_settings.py b/src/onaptests/configuration/ubuntu16_nomulticloud_settings.py
index e9f1bf6..c6c9e66 100644
--- a/src/onaptests/configuration/ubuntu16_nomulticloud_settings.py
+++ b/src/onaptests/configuration/ubuntu16_nomulticloud_settings.py
@@ -1,5 +1,6 @@
import os
import openstack
+import sys
from yaml import load
from .settings import * # pylint: disable=W0614
@@ -12,13 +13,12 @@ USE_MULTICLOUD = False
# Set ONLY_INSTANTIATE to true to run an instantiation without repeating
# onboarding and related AAI configuration (Cloud config)
ONLY_INSTANTIATE= False
-SERVICE_YAML_TEMPLATE = "src/onaptests/templates/vnf-services/ubuntu16test-service.yaml"
-CLEANUP_FLAG = True
-CLEANUP_ACTIVITY_TIMER = 10 # nb of seconds before cleanup in case cleanup option is set
-VENDOR_NAME = "basicvm_vendor"
-VF_NAME = "basicvm_ubuntu_vf"
-VSP_NAME = "basicvm_ubuntu_vsp"
+# if a yaml file is define, retrieve info from this yaml files
+# if not declare the parameters in the settings
+SERVICE_YAML_TEMPLATE = (sys.path[-1] + "/onaptests/templates/vnf-services/" +
+ "ubuntu16test-service.yaml")
+
try:
# Try to retrieve the SERVICE NAME from the yaml file
with open(SERVICE_YAML_TEMPLATE, "r") as yaml_template:
@@ -27,6 +27,13 @@ try:
except ValueError:
SERVICE_NAME = "" # Fill me
+CLEANUP_FLAG = True
+CLEANUP_ACTIVITY_TIMER = 10 # nb of seconds before cleanup in case cleanup option is set
+VENDOR_NAME = "basicvm_vendor"
+
+VF_NAME = "basicvm_ubuntu_vf"
+VSP_NAME = "basicvm_ubuntu_vsp"
+
CLOUD_REGION_CLOUD_OWNER = "basicvm-cloud-owner"
CLOUD_REGION_TYPE = "openstack"
CLOUD_REGION_VERSION = "openstack"
@@ -45,9 +52,6 @@ PLATFORM = "basicvm-platform"
SERVICE_INSTANCE_NAME = "basicvm_ubuntu16_service_instance"
-VSP_FILE_PATH = "src/onaptests/templates/templates/heat-files/ubuntu16/ubuntu16.zip"
-
-
# The cloud Part
# Assuming a cloud.yaml is available, use the openstack client
# to retrieve cloud info and avoid data duplication