from onapsdk.sdc.vsp import Vsp
from onaptests.utils.resources import get_resource_location
+
from ..base import BaseStep, YamlTemplateBaseStep
from .vsp import VspOnboardStep, YamlTemplateVspOnboardStep
def cleanup(self):
try:
pnf = Pnf.get_by_name(settings.PNF_NAME)
- pnf.archive()
+ if pnf.lifecycle_state == LifecycleState.CERTIFIED:
+ pnf.archive()
pnf.delete()
except ResourceNotFound:
self._logger.warning("VF not created")
for pnf in self.yaml_template["pnfs"]:
try:
pnf_obj: Pnf = Pnf.get_by_name(name=pnf["pnf_name"])
- pnf_obj.archive()
+ if pnf_obj.lifecycle_state == LifecycleState.CERTIFIED:
+ pnf_obj.archive()
pnf_obj.delete()
except ResourceNotFound:
self._logger.warning(f"PNF {pnf['pnf_name']} does not exist")