diff options
author | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2023-03-16 13:43:57 +0000 |
---|---|---|
committer | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2023-03-17 11:06:08 +0000 |
commit | 066e6c39c2a5133f89d1f00f25a247f7ce402f10 (patch) | |
tree | b2d7eb9b67ee7ec53da8ad2aa2aa8dff0b4758fd /src/onaptests/steps/onboard/pnf.py | |
parent | d6d052a5f1ce0ae0f0debcbb11220fce1c1dfdc5 (diff) |
Fix tests regression
Delete SDC resources only if exists and archive all before delete
Bump onapsdk requirements
Issue-ID: INT-2193
Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl>
Change-Id: I1c116b93ab1dc4be2501df57b2a7d2d97354cfa5
Diffstat (limited to 'src/onaptests/steps/onboard/pnf.py')
-rw-r--r-- | src/onaptests/steps/onboard/pnf.py | 8 |
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() |