aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/onboard/vsp.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/onaptests/steps/onboard/vsp.py')
-rw-r--r--src/onaptests/steps/onboard/vsp.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/onaptests/steps/onboard/vsp.py b/src/onaptests/steps/onboard/vsp.py
index 577b1cf..06e0fa2 100644
--- a/src/onaptests/steps/onboard/vsp.py
+++ b/src/onaptests/steps/onboard/vsp.py
@@ -10,14 +10,14 @@ from .vendor import VendorOnboardStep
class VspOnboardStep(BaseStep):
"""Vsp onboard step."""
- def __init__(self, cleanup=False):
+ def __init__(self):
"""Initialize step.
Substeps:
- VendorOnboardStep.
"""
- super().__init__(cleanup=cleanup)
- self.add_step(VendorOnboardStep(cleanup=cleanup))
+ super().__init__(cleanup=settings.CLEANUP_FLAG)
+ self.add_step(VendorOnboardStep())
@property
def description(self) -> str:
@@ -29,6 +29,13 @@ class VspOnboardStep(BaseStep):
"""Component name."""
return "SDC"
+ def check_preconditions(self, cleanup=False) -> bool:
+ if not super().check_preconditions(cleanup):
+ return False
+ if cleanup:
+ return settings.SDC_CLEANUP
+ return True
+
@BaseStep.store_state
def execute(self):
"""Onboard Vsp.
@@ -58,14 +65,14 @@ class VspOnboardStep(BaseStep):
class YamlTemplateVspOnboardStep(YamlTemplateBaseStep):
"""Vsp onboard using YAML template step."""
- def __init__(self, cleanup=False):
+ def __init__(self):
"""Initialize step.
Substeps:
- VendorOnboardStep.
"""
- super().__init__(cleanup=cleanup)
- self.add_step(VendorOnboardStep(cleanup=cleanup))
+ super().__init__(cleanup=settings.CLEANUP_FLAG)
+ self.add_step(VendorOnboardStep())
@property
def description(self) -> str:
@@ -77,6 +84,13 @@ class YamlTemplateVspOnboardStep(YamlTemplateBaseStep):
"""Component name."""
return "SDC"
+ def check_preconditions(self, cleanup=False) -> bool:
+ if not super().check_preconditions(cleanup):
+ return False
+ if cleanup:
+ return settings.SDC_CLEANUP
+ return True
+
@property
def yaml_template(self) -> dict:
"""YAML template.