diff options
Diffstat (limited to 'src/onaptests/configuration/multi_vnf_ubuntu_settings.py')
-rw-r--r-- | src/onaptests/configuration/multi_vnf_ubuntu_settings.py | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/onaptests/configuration/multi_vnf_ubuntu_settings.py b/src/onaptests/configuration/multi_vnf_ubuntu_settings.py index bdf6576..78b6a1b 100644 --- a/src/onaptests/configuration/multi_vnf_ubuntu_settings.py +++ b/src/onaptests/configuration/multi_vnf_ubuntu_settings.py @@ -3,7 +3,6 @@ import uuid from pathlib import Path import openstack -from jinja2 import Environment, PackageLoader from onaptests.utils.resources import get_resource_location @@ -15,25 +14,6 @@ SERVICE_NAME = f"multivnfubuntu{str(uuid.uuid4().hex)[:6]}" SERVICE_DETAILS = "Onboarding, distribution and instanitation of an Mutli VM service using macro" -# We need to create a service file with a random service name, -# to be sure that we force onboarding -def generate_service_config_yaml_file(filename): - """generate the service file with a random service name - from a jinja template""" - - env = Environment( - loader=PackageLoader('onaptests', 'templates/vnf-services'), - ) - template = env.get_template(f"{filename}.yaml.j2") - - rendered_template = template.render(service_name=SERVICE_NAME) - - file_name = get_resource_location(f"templates/vnf-services/{filename}.yaml") - - with open(file_name, 'w+', encoding="utf-8") as file_to_write: - file_to_write.write(rendered_template) - - CLEANUP_FLAG = True CDS_DD_FILE = Path(get_resource_location("templates/artifacts/dd_nso_ubuntu.json")) @@ -81,7 +61,11 @@ MODEL_YAML_TEMPLATE = Path(get_resource_location("templates/vnf-services/" + f"{VNF_FILENAME_PREFIX}-model.yaml")) -generate_service_config_yaml_file(f"{VNF_FILENAME_PREFIX}-service") -generate_service_config_yaml_file(f"{VNF_FILENAME_PREFIX}-model") +generate_service_config_yaml_file(f"{VNF_FILENAME_PREFIX}-service", # noqa + f"{VNF_FILENAME_PREFIX}-service.yaml.j2", + str(SERVICE_YAML_TEMPLATE)) +generate_service_config_yaml_file(f"{VNF_FILENAME_PREFIX}-model", # noqa + f"{VNF_FILENAME_PREFIX}-model.yaml.j2", + str(MODEL_YAML_TEMPLATE)) SERVICE_INSTANCE_NAME = f"{SERVICE_NAME}_svc" |