aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-12-15 09:12:17 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-12-15 09:12:17 +0800
commit0e32012d2b0238bb2662f5d0ac44666b99732e8c (patch)
tree72531e7b18026a531ff42ffc55bf0af7fe95d3df
parente390605fe7d0cf04b8e69c101544ab2c9eff2086 (diff)
Resolve VFC code and swagger inconsistencies
Add resourceName in affectedVL of notify Change-Id: Ib2c3d0689eef0dcd9d05083b0610b4bb91898d6a Issue-ID: VFC-620 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--lcm/ns/vnfs/notify_lcm.py8
-rw-r--r--lcm/swagger/vfc.vnfdriver.swagger.json4
2 files changed, 9 insertions, 3 deletions
diff --git a/lcm/ns/vnfs/notify_lcm.py b/lcm/ns/vnfs/notify_lcm.py
index 9ebd89e5..4ec80526 100644
--- a/lcm/ns/vnfs/notify_lcm.py
+++ b/lcm/ns/vnfs/notify_lcm.py
@@ -106,6 +106,7 @@ class NotifyLcm(object):
networkResource = ignore_case_get(vl, 'networkResource')
resourceType = ignore_case_get(networkResource, 'resourceType')
resourceId = ignore_case_get(networkResource, 'resourceId')
+ resourceName = ignore_case_get(networkResource, 'resourceName')
if resourceType != 'network':
self.exception('affectedVl struct error: resourceType not euqal network')
@@ -113,13 +114,14 @@ class NotifyLcm(object):
ownerId = self.get_vnfinstid(self.m_vnfInstanceId, self.vnfmid)
if changeType == 'added':
- VLInstModel(vlinstanceid=vlInstanceId, vldid=vldid, ownertype=0, ownerid=ownerId,
- relatednetworkid=resourceId, vltype=0).save()
+ VLInstModel(vlinstanceid=vlInstanceId, vldid=vldid, vlinstancename=resourceName, ownertype=0,
+ ownerid=ownerId, relatednetworkid=resourceId, vltype=0).save()
elif changeType == 'removed':
VLInstModel.objects.filter(vlinstanceid=vlInstanceId).delete()
elif changeType == 'modified':
VLInstModel.objects.filter(vlinstanceid=vlInstanceId)\
- .update(vldid=vldid, ownertype=0, ownerid=ownerId, relatednetworkid=resourceId, vltype=0)
+ .update(vldid=vldid, vlinstancename=resourceName, ownertype=0, ownerid=ownerId,
+ relatednetworkid=resourceId, vltype=0)
else:
self.exception('affectedVl struct error: changeType not in {added,removed,modified}')
diff --git a/lcm/swagger/vfc.vnfdriver.swagger.json b/lcm/swagger/vfc.vnfdriver.swagger.json
index 38b30831..49d032ef 100644
--- a/lcm/swagger/vfc.vnfdriver.swagger.json
+++ b/lcm/swagger/vfc.vnfdriver.swagger.json
@@ -781,6 +781,10 @@
"resourceId": {
"type": "string",
"description": "Identifier of the resource in the scope of the VIM"
+ },
+ "resourceName": {
+ "type": "string",
+ "description": "Name of the resource in the scope of the VIM"
}
}
}