aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/onboard/vsp.py
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2024-01-28 19:45:44 +0100
committerLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2024-01-29 22:24:42 +0100
commita7edeebc90bdd335361a7b36f5f5d12a14375554 (patch)
tree0e48ee456ef26471271c5412f3205aafcda41857 /src/onaptests/steps/onboard/vsp.py
parent2479155376b6142e97163a7903632015fed50815 (diff)
Enhanced validation of configuration of all tests
Issue-ID: TEST-402 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> Change-Id: I2e4ef6365b44c33f4c0b3e72886a83f92c63e2f3
Diffstat (limited to 'src/onaptests/steps/onboard/vsp.py')
-rw-r--r--src/onaptests/steps/onboard/vsp.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/onaptests/steps/onboard/vsp.py b/src/onaptests/steps/onboard/vsp.py
index 06e0fa2..36e78df 100644
--- a/src/onaptests/steps/onboard/vsp.py
+++ b/src/onaptests/steps/onboard/vsp.py
@@ -48,10 +48,11 @@ class VspOnboardStep(BaseStep):
"""
super().execute()
vendor: Vendor = Vendor(name=settings.VENDOR_NAME)
- vsp: Vsp = Vsp(name=settings.VSP_NAME,
- vendor=vendor,
- package=open(settings.VSP_FILE_PATH, "rb"))
- vsp.onboard()
+ with open(settings.VSP_FILE_PATH, "rb") as vsp_file:
+ vsp: Vsp = Vsp(name=settings.VSP_NAME,
+ vendor=vendor,
+ package=vsp_file)
+ vsp.onboard()
@BaseStep.store_state(cleanup=True)
def cleanup(self):
@@ -103,8 +104,7 @@ class YamlTemplateVspOnboardStep(YamlTemplateBaseStep):
"""
if settings.MODEL_YAML_TEMPLATE:
return self.model_yaml_template
- else:
- return self.parent.yaml_template
+ return self.parent.yaml_template
@property
def model_yaml_template(self) -> dict: