summaryrefslogtreecommitdiffstats
path: root/zte
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-11-10 15:44:14 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-11-10 15:44:14 +0800
commitf8df2f9807b1dfd5deb051118b6210607124fa34 (patch)
tree434406ea613d41c48f636ed8609c50d4b640b639 /zte
parent356e70485879cf372051003c0c0a242dbe0bc8ae (diff)
Fix vfc-ztevmanagerdriver notify bug
Change-Id: If374bff110fc614927d02c5af341ce156fc3d4e3 Issue-ID: VFC-589 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'zte')
-rw-r--r--zte/vmanager/driver/interfaces/views.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py
index bb5d0b77..58dac487 100644
--- a/zte/vmanager/driver/interfaces/views.py
+++ b/zte/vmanager/driver/interfaces/views.py
@@ -406,7 +406,13 @@ def notify(request, *args, **kwargs):
data["affectedVirtualStorage"] = []
data["affectedCp"] = []
- affectedvnfcs = ignorcase_get(ignorcase_get(request.data, "extension"), "affectedvnfc")
+ extension = ignorcase_get(request.data, "extension")
+ openo_notification = ignorcase_get(extension, "openo_notification")
+ if openo_notification:
+ affectedvnfcs = ignorcase_get(openo_notification, "affectedVnfc")
+ else:
+ affectedvnfcs = ignorcase_get(ignorcase_get(request.data, "extension"), "affectedvnfc")
+
affectedvls = ignorcase_get(ignorcase_get(request.data, "extension"), "affectedvl")
affectedcps = ignorcase_get(ignorcase_get(request.data, "extension"), "affectedcp")
vnfdmodule = ignorcase_get(ignorcase_get(request.data, "extension"), "vnfdmodule")
@@ -415,12 +421,12 @@ def notify(request, *args, **kwargs):
for affectedvnfc in affectedvnfcs:
data["affectedVnfc"].append({
- "vnfcInstanceId": ignorcase_get(affectedvnfc, "vnfcinstanceid"),
+ "vnfcInstanceId": ignorcase_get(affectedvnfc, "vnfcInstanceId"),
"vduId": ignorcase_get(affectedvnfc, "vduId"),
"changeType": ignorcase_get(affectedvnfc, "changeType"),
- "vimid": ignorcase_get(ignorcase_get(affectedvnfc, "computeresource"), "vimid"),
- "vmId": ignorcase_get(ignorcase_get(affectedvnfc, "computeresource"), "resourceid"),
- "vmName": ignorcase_get(ignorcase_get(affectedvnfc, "computeresource"), "resourcename")
+ "vimid": ignorcase_get(ignorcase_get(affectedvnfc, "computeResource"), "vimId"),
+ "vmId": ignorcase_get(ignorcase_get(affectedvnfc, "computeResource"), "resourceId"),
+ "vmName": ignorcase_get(ignorcase_get(affectedvnfc, "computeResource"), "resourceName")
})
for affectedvl in affectedvls:
@@ -448,6 +454,7 @@ def notify(request, *args, **kwargs):
return Response(data={'error': ret[1]}, status=ret[2])
except Exception as e:
logger.error("Error occurred in LCM notification.")
+ logger.error(traceback.format_exc())
raise e
return Response(data=None, status=ret[2])