vfclcm upgrade from python2 to python3
[vfc/gvnfm/vnflcm.git] / lcm / lcm / nf / biz / operate_vnf.py
index 775def3..1722792 100644 (file)
@@ -28,7 +28,6 @@ from lcm.pub.utils.notificationsutil import NotificationsUtil
 from lcm.pub.utils.values import ignore_case_get
 from lcm.pub.vimapi import adaptor
 from lcm.nf.biz.grant_vnf import grant_resource
-from lcm.nf.const import VNF_STATUS
 from lcm.nf.const import RESOURCE_MAP
 from lcm.nf.const import GRANT_TYPE
 from lcm.nf.const import OPERATION_STATE_TYPE
@@ -76,11 +75,11 @@ class OperateVnf(Thread):
                 OPERATION_STATE_TYPE.COMPLETED
             )
         except NFLCMException as e:
-            self.vnf_operate_failed_handle(e.message)
+            self.vnf_operate_failed_handle(e.args[0])
         except Exception as e:
-            logger.error(e.message)
+            logger.error(e.args[0])
             logger.error(traceback.format_exc())
-            self.vnf_operate_failed_handle(e.message)
+            self.vnf_operate_failed_handle(e.args[0])
 
     def apply_grant(self):
         vdus = VmInstModel.objects.filter(instid=self.nf_inst_id)
@@ -129,7 +128,7 @@ class OperateVnf(Thread):
     def vnf_operate_failed_handle(self, error_msg):
         logger.error('VNF Operation failed, detail message: %s' % error_msg)
         NfInstModel.objects.filter(nfinstid=self.nf_inst_id).update(
-            status=VNF_STATUS.FAILED,
+            status=VNF_STATUS.FAILED,
             lastuptime=now_time()
         )
         self.lcm_op_occ.notify_lcm(OPERATION_STATE_TYPE.FAILED, error_msg)