summaryrefslogtreecommitdiffstats
path: root/lcm/lcm/nf/biz/terminate_vnf.py
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2018-11-17 14:39:13 +0800
committerFu Jinhua <fu.jinhua@zte.com.cn>2018-11-20 12:26:39 +0000
commit4f82607bbc26823472e58e2073a20ca928db5bd9 (patch)
tree99e371bf7183b22f03242202e519a85505e04ab7 /lcm/lcm/nf/biz/terminate_vnf.py
parentf90a8ca14fd25b86ca00e2aba52e3f48de4683d4 (diff)
Add lcm notify call in vnf inst and term
Change-Id: I7808360954933f1dbdcb2ae9341bb1e2d8e69c6c Issue-ID: VFC-1163 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn> (cherry picked from commit 1cbfeb8366d32855c1d4daf4e7371bb4081f89de)
Diffstat (limited to 'lcm/lcm/nf/biz/terminate_vnf.py')
-rw-r--r--lcm/lcm/nf/biz/terminate_vnf.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/lcm/lcm/nf/biz/terminate_vnf.py b/lcm/lcm/nf/biz/terminate_vnf.py
index 250ce7fa..b9e6dd3a 100644
--- a/lcm/lcm/nf/biz/terminate_vnf.py
+++ b/lcm/lcm/nf/biz/terminate_vnf.py
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# import json
+import json
import logging
import traceback
from threading import Thread
@@ -25,7 +25,7 @@ from lcm.pub.database.models import (
)
from lcm.pub.exceptions import NFLCMException
from lcm.pub.msapi.gvnfmdriver import prepare_notification_data
-# from lcm.pub.msapi.gvnfmdriver import notify_lcm_to_nfvo
+from lcm.pub.msapi.gvnfmdriver import notify_lcm_to_nfvo
from lcm.pub.utils.jobutil import JobUtil
from lcm.pub.utils.timeutil import now_time
from lcm.pub.utils.notificationsutil import NotificationsUtil
@@ -122,8 +122,11 @@ class TerminateVnf(Thread):
def lcm_notify(self):
NfInstModel.objects.filter(nfinstid=self.nf_inst_id).update(status='NOT_INSTANTIATED', lastuptime=now_time())
logger.info('Send notify request to nfvo')
- # resp = notify_lcm_to_nfvo(json.dumps(self.notify_data))
- # logger.info('Lcm notify end, response: %s' % resp)
+ try:
+ resp = notify_lcm_to_nfvo(json.dumps(self.notify_data))
+ logger.info('Lcm notify end, response: %s' % resp)
+ except Exception as e:
+ logger.error("Lcm terminate notify failed: %s", e.message)
NotificationsUtil().send_notification(self.notify_data)
def vnf_term_failed_handle(self, error_msg):