aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/onboard/vf.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/onaptests/steps/onboard/vf.py')
-rw-r--r--src/onaptests/steps/onboard/vf.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/onaptests/steps/onboard/vf.py b/src/onaptests/steps/onboard/vf.py
index b614fd5..3fc7443 100644
--- a/src/onaptests/steps/onboard/vf.py
+++ b/src/onaptests/steps/onboard/vf.py
@@ -13,14 +13,14 @@ from .vsp import VspOnboardStep, YamlTemplateVspOnboardStep
class VfOnboardStep(BaseStep):
"""Vf onboard step."""
- def __init__(self, cleanup=False):
+ def __init__(self):
"""Initialize step.
Substeps:
- VspOnboardStep.
"""
- super().__init__(cleanup=cleanup)
- self.add_step(VspOnboardStep(cleanup=cleanup))
+ super().__init__(cleanup=settings.CLEANUP_FLAG)
+ self.add_step(VspOnboardStep())
@property
def description(self) -> str:
@@ -32,6 +32,13 @@ class VfOnboardStep(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 Vf.
@@ -59,14 +66,14 @@ class VfOnboardStep(BaseStep):
class YamlTemplateVfOnboardStep(YamlTemplateBaseStep):
"""Vf onboard using YAML template step."""
- def __init__(self, cleanup=False) -> None:
+ def __init__(self) -> None:
"""Initialize step.
Substeps:
- YamlTemplateVspOnboardStep.
"""
- super().__init__(cleanup=cleanup)
- self.add_step(YamlTemplateVspOnboardStep(cleanup=cleanup))
+ super().__init__(cleanup=settings.CLEANUP_FLAG)
+ self.add_step(YamlTemplateVspOnboardStep())
@property
def description(self) -> str:
@@ -78,6 +85,13 @@ class YamlTemplateVfOnboardStep(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.