aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/onboard/pnf.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/onaptests/steps/onboard/pnf.py')
-rw-r--r--src/onaptests/steps/onboard/pnf.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/onaptests/steps/onboard/pnf.py b/src/onaptests/steps/onboard/pnf.py
index 75fdbcf..1c76202 100644
--- a/src/onaptests/steps/onboard/pnf.py
+++ b/src/onaptests/steps/onboard/pnf.py
@@ -63,7 +63,9 @@ class PnfOnboardStep(BaseStep):
@BaseStep.store_state(cleanup=True)
def cleanup(self):
pnf: Pnf = Pnf(name=settings.PNF_NAME)
- pnf.delete()
+ if pnf.exists():
+ pnf.archive()
+ pnf.delete()
super().cleanup()
@@ -136,5 +138,7 @@ class YamlTemplatePnfOnboardStep(YamlTemplateBaseStep):
if "pnfs" in self.yaml_template:
for pnf in self.yaml_template["pnfs"]:
pnf_obj: Pnf = Pnf(name=pnf["pnf_name"])
- pnf_obj.delete()
+ if pnf_obj.exists():
+ pnf_obj.archive()
+ pnf_obj.delete()
super().cleanup()