summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2018-11-17 14:32:06 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2018-11-17 15:21:47 +0800
commit6c118cfae9c079e26a626cb20b360422e9fa867c (patch)
treecbdc6e5b09b1fc29a446fa1eebf4c59a7f6e60bb
parenteabc459850ca03d0f4fe7eca39c679951c03bcb5 (diff)
Fix lcm notify api logic
Change-Id: Ieba3b96335ab99050ae2bfb2de25a99726e0ad2f Issue-ID: VFC-1163 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/ns_vnfs/biz/handle_notification.py2
-rw-r--r--lcm/ns_vnfs/tests/vnf_tests.py8
-rw-r--r--lcm/ns_vnfs/urls.py4
-rw-r--r--lcm/ns_vnfs/views/vnf_views.py6
4 files changed, 10 insertions, 10 deletions
diff --git a/lcm/ns_vnfs/biz/handle_notification.py b/lcm/ns_vnfs/biz/handle_notification.py
index 20225088..aee6e9c8 100644
--- a/lcm/ns_vnfs/biz/handle_notification.py
+++ b/lcm/ns_vnfs/biz/handle_notification.py
@@ -41,7 +41,7 @@ class HandleVnfLcmOocNotification(object):
self.vnf_instid = get_vnfinstid(self.m_vnfInstanceId, self.vnfmid)
self.operation = ignore_case_get(data, 'operation')
self.affectedVnfcs = ignore_case_get(data, 'affectedVnfcs')
- self.affectedVls = ignore_case_get(data, 'affectedVls')
+ self.affectedVls = ignore_case_get(data, 'affectedVirtualLinks')
self.affectedCps = ignore_case_get(data, 'changedExtConnectivity')
self.affectedVirtualStorage = ignore_case_get(data, 'affectedVirtualStorages')
diff --git a/lcm/ns_vnfs/tests/vnf_tests.py b/lcm/ns_vnfs/tests/vnf_tests.py
index 4c088944..fbdb5316 100644
--- a/lcm/ns_vnfs/tests/vnf_tests.py
+++ b/lcm/ns_vnfs/tests/vnf_tests.py
@@ -165,20 +165,20 @@ class VnfGrantViewTest(unittest.TestCase):
self.assertEqual(expect_resp_data, resp_data)
def test_get_notify_vnf_normal(self):
- response = self.client.get("/api/nslcm/v2/ns/1/ns_vnfs/1/Notify")
+ response = self.client.get("/api/nslcm/v2/ns/1/vnfs/1/Notify")
self.assertEqual(status.HTTP_204_NO_CONTENT, response.status_code, response.content)
def test_notify_vnflcmopooc_normal(self):
NfInstModel.objects.create(nfinstid='22',
mnfinstid='2',
vnfm_inst_id='1')
- response = self.client.post("/api/nslcm/v2/ns/1/ns_vnfs/2/Notify",
+ response = self.client.post("/api/nslcm/v2/ns/1/vnfs/2/Notify",
data=VNF_LCM_OP_OCC_NOTIFICATION_DATA,
format='json')
self.assertEqual(status.HTTP_204_NO_CONTENT, response.status_code)
def test_notify_vnf_identifier_creation_normal(self):
- response = self.client.post("/api/nslcm/v2/ns/1/ns_vnfs/2/Notify",
+ response = self.client.post("/api/nslcm/v2/ns/1/vnfs/2/Notify",
data=VNF_IDENTIFIER_CREATION_NOTIFICATION_DATA,
format='json')
self.assertEqual(status.HTTP_204_NO_CONTENT, response.status_code)
@@ -187,7 +187,7 @@ class VnfGrantViewTest(unittest.TestCase):
NfInstModel.objects.create(nfinstid='22',
mnfinstid='2',
vnfm_inst_id='1')
- response = self.client.post("/api/nslcm/v2/ns/1/ns_vnfs/2/Notify",
+ response = self.client.post("/api/nslcm/v2/ns/1/vnfs/2/Notify",
data=VNF_IDENTIFIER_DELETION_NOTIFICATION_DATA,
format='json')
self.assertEqual(status.HTTP_204_NO_CONTENT, response.status_code)
diff --git a/lcm/ns_vnfs/urls.py b/lcm/ns_vnfs/urls.py
index ce972efa..49b4d14e 100644
--- a/lcm/ns_vnfs/urls.py
+++ b/lcm/ns_vnfs/urls.py
@@ -25,7 +25,7 @@ urlpatterns = [
url(r'^api/nslcm/v1/ns/terminatevnf/(?P<vnfinstid>[0-9a-zA-Z_-]+)$', NfTerminate.as_view()),
url(r'^api/nslcm/v1/ns/grantvnf$', NfGrant.as_view()),
url(r'^api/nslcm/v1/ns/placevnf$', NfPlacement.as_view()),
- url(r'^api/nslcm/v1/ns/(?P<vnfmid>[0-9a-zA-Z_-]+)/ns_vnfs/(?P<vnfInstanceId>[0-9a-zA-Z_-]+)/Notify$', LcmNotify.as_view()),
+ url(r'^api/nslcm/v1/ns/(?P<vnfmid>[0-9a-zA-Z_-]+)/vnfs/(?P<vnfInstanceId>[0-9a-zA-Z_-]+)/Notify$', LcmNotify.as_view()),
url(r'^api/nslcm/v1/ns/ns_vnfs/(?P<vnfinstid>[0-9a-zA-Z_-]+)/scaling$', NfScaleView.as_view()),
url(r'^api/nslcm/v1/vnfonboarding$', NfVerifyView.as_view()),
url(r'^api/nslcm/v1/vnfms/(?P<vnfmid>[0-9a-zA-Z_-]+)', NfVnfmInfoView.as_view()),
@@ -33,7 +33,7 @@ urlpatterns = [
# move form v2
url(r'^api/nslcm/v2/grants$', VnfGrantView.as_view()),
- url(r'^api/nslcm/v2/ns/(?P<vnfmId>[0-9a-zA-Z_-]+)/ns_vnfs/(?P<vnfInstanceId>[0-9a-zA-Z_-]+)/Notify$',
+ url(r'^api/nslcm/v2/ns/(?P<vnfmId>[0-9a-zA-Z_-]+)/vnfs/(?P<vnfInstanceId>[0-9a-zA-Z_-]+)/Notify$',
VnfNotifyView.as_view()),
]
diff --git a/lcm/ns_vnfs/views/vnf_views.py b/lcm/ns_vnfs/views/vnf_views.py
index 31906a22..c096c02e 100644
--- a/lcm/ns_vnfs/views/vnf_views.py
+++ b/lcm/ns_vnfs/views/vnf_views.py
@@ -77,17 +77,17 @@ class VnfNotifyView(APIView):
if notification_type == 'VnfLcmOperationOccurrenceNotification':
notification = VnfLcmOperationOccurrenceNotificationSerializer(data=request.data)
if not notification.is_valid():
- raise Exception(notification.errors)
+ logger.warn(notification.errors)
HandleVnfLcmOocNotification(vnfmId, vnfInstanceId, notification.data).do_biz()
elif notification_type == 'VnfIdentifierCreationNotification':
notification = VnfIdentifierCreationNotificationSerializer(data=request.data)
if not notification.is_valid():
- raise Exception(notification.errors)
+ logger.warn(notification.errors)
HandleVnfIdentifierCreationNotification(vnfmId, vnfInstanceId, notification.data).do_biz()
elif notification_type == 'VnfIdentifierDeletionNotification':
notification = VnfIdentifierDeletionNotificationSerializer(data=request.data)
if not notification.is_valid():
- raise Exception(notification.errors)
+ logger.warn(notification.errors)
HandleVnfIdentifierDeletionNotification(vnfmId, vnfInstanceId, notification.data).do_biz()
else:
raise Exception('Unexpected noitifcation type value.')