from lcm.nf.biz.heal_vnf import HealVnf\r
from lcm.nf.serializers.heal_vnf_req import HealVnfRequestSerializer\r
from lcm.nf.serializers.response import ProblemDetailsSerializer\r
-from lcm.pub.exceptions import NFLCMException, NFLCMExceptionNotFound\r
+from lcm.pub.exceptions import NFLCMException\r
+from lcm.pub.exceptions import NFLCMExceptionNotFound\r
+from lcm.pub.exceptions import NFLCMExceptionConflict\r
from lcm.pub.utils.jobutil import JobUtil\r
from lcm.pub.database.models import NfInstModel\r
from lcm.nf.const import VNF_STATUS\r
if not vnf_insts.exists():\r
raise NFLCMExceptionNotFound("VNF nf_inst_id does not exist.")\r
\r
+ if vnf_insts[0].status != 'INSTANTIATED':\r
+ raise NFLCMExceptionConflict("VNF instantiationState is not INSTANTIATED.")\r
+\r
NfInstModel.objects.filter(nfinstid=nf_inst_id).update(status=VNF_STATUS.HEALING)\r
JobUtil.add_job_status(job_id, 15, 'Nf healing pre-check finish')\r
logger.info("Nf healing pre-check finish")\r