From 3e390f1d45785bca5beb1f5c2fa57ef59f6736e9 Mon Sep 17 00:00:00 2001 From: mrichomme Date: Tue, 29 Sep 2020 16:08:46 +0200 Subject: 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 Change-Id: I57bf303b497e4d2b1dd740286f07beb3783222b1 Signed-off-by: mrichomme --- src/onaptests/steps/onboard/vsp.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/onaptests/steps') diff --git a/src/onaptests/steps/onboard/vsp.py b/src/onaptests/steps/onboard/vsp.py index 50f1dfc..8ac47b5 100644 --- a/src/onaptests/steps/onboard/vsp.py +++ b/src/onaptests/steps/onboard/vsp.py @@ -1,3 +1,4 @@ +import sys from onapsdk.configuration import settings from onapsdk.sdc.vendor import Vendor from onapsdk.sdc.vsp import Vsp @@ -66,6 +67,9 @@ class YamlTemplateVspOnboardStep(YamlTemplateBaseStep): super().execute() vendor: Vendor = Vendor(name=settings.VENDOR_NAME) for vnf in self.yaml_template["vnfs"]: - with open(vnf["heat_files_to_upload"], "rb") as package: - vsp: Vsp = Vsp(name=f"{vnf['vnf_name']}_VSP", vendor=vendor, package=package) + with open( + sys.path[-1] + "/" + vnf["heat_files_to_upload"], "rb") as package: + vsp: Vsp = Vsp(name=f"{vnf['vnf_name']}_VSP", + vendor=vendor, + package=package) vsp.onboard() -- cgit 1.2.3-korg