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.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/onaptests/steps/onboard/vf.py b/src/onaptests/steps/onboard/vf.py
index f77f9af..b614fd5 100644
--- a/src/onaptests/steps/onboard/vf.py
+++ b/src/onaptests/steps/onboard/vf.py
@@ -50,7 +50,9 @@ class VfOnboardStep(BaseStep):
@BaseStep.store_state(cleanup=True)
def cleanup(self):
vf: Vf = Vf(name=settings.VF_NAME)
- vf.delete()
+ if vf.exists():
+ vf.archive()
+ vf.delete()
super().cleanup()
@@ -134,5 +136,7 @@ class YamlTemplateVfOnboardStep(YamlTemplateBaseStep):
if "vnfs" in self.yaml_template:
for vnf in self.yaml_template["vnfs"]:
vf_obj: Vf = Vf(name=vnf["vnf_name"])
- vf_obj.delete()
+ if vf_obj.exists():
+ vf_obj.archive()
+ vf_obj.delete()
super().cleanup()