diff options
author | Fu Jinhua <fu.jinhua@zte.com.cn> | 2017-11-06 08:42:50 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-11-06 08:42:50 +0000 |
commit | b0d27ae27e3cbd210fd181cbefe1fb430a6a6d22 (patch) | |
tree | 04a95960e6399d3a6e06a3bcdbda4d9e46910861 | |
parent | b718193935874e2020842012db474ee4f1010458 (diff) | |
parent | b7d4cdbf683a119a644868cdbdbe16a4419701a3 (diff) |
Merge "Fix vfc-nslcm vl creation to aai"
-rw-r--r-- | lcm/ns/vls/create_vls.py | 15 | ||||
-rw-r--r-- | lcm/ns/vnfs/notify_lcm.py | 13 |
2 files changed, 16 insertions, 12 deletions
diff --git a/lcm/ns/vls/create_vls.py b/lcm/ns/vls/create_vls.py index 18abfa26..c8bfdedd 100644 --- a/lcm/ns/vls/create_vls.py +++ b/lcm/ns/vls/create_vls.py @@ -197,6 +197,9 @@ class CreateVls(object): def create_network_and_subnet_in_aai(self): logger.debug("CreateVls::create_network_in_aai::report network[%s] to aai." % self.vl_inst_id) try: + ns_insts = NSInstModel.objects.filter(id=self.owner_id) + self.global_customer_id = ns_insts[0].global_customer_id + self.service_type = ns_insts[0].service_type data = { "network-id": self.vl_inst_id, "network-name": self.vl_inst_name, @@ -215,10 +218,18 @@ class CreateVls(object): "relationship-list": { "relationship": [ { - "related-to": "generic-vnf", + "related-to": "service-instance", "relationship-data": [ { - "relationship-key": "generic-vnf.vnf-id", + "relationship-key": "customer.global-customer-id", + "relationship-value": self.global_customer_id + }, + { + "relationship-key": "service-subscription.service-type", + "relationship-value": self.service_type + }, + { + "relationship-key": "service-instance.service-instance-id", "relationship-value": self.owner_id } ] diff --git a/lcm/ns/vnfs/notify_lcm.py b/lcm/ns/vnfs/notify_lcm.py index b51b490f..504be558 100644 --- a/lcm/ns/vnfs/notify_lcm.py +++ b/lcm/ns/vnfs/notify_lcm.py @@ -220,10 +220,7 @@ class NotifyLcm(object): } } resp_data, resp_status = create_network_aai(vlInstanceId, data) - if resp_data: - logger.debug("Fail to create network[%s] to aai: [%s].", vlInstanceId, resp_status) - else: - logger.debug("Success to create network[%s] to aai: [%s].", vlInstanceId, resp_status) + logger.debug("Success to create network[%s] to aai: [%s].", vlInstanceId, resp_status) except NSLCMException as e: logger.debug("Fail to create network[%s] to aai, detail message: %s" % (vlInstanceId, e.message)) except: @@ -238,12 +235,8 @@ class NotifyLcm(object): # delete network from aai resp_data, resp_status = delete_network_aai(vlInstanceId, resource_version) - if resp_data: - logger.debug("Fail to delete network[%s] from aai, resp_status: [%s]." - % (vlInstanceId, resp_status)) - else: - logger.debug("Success to delete network[%s] from aai, resp_status: [%s]." - % (vlInstanceId, resp_status)) + logger.debug("Success to delete network[%s] from aai, resp_status: [%s]." + % (vlInstanceId, resp_status)) except NSLCMException as e: logger.debug("Fail to delete network[%s] to aai, detail message: %s" % (vlInstanceId, e.message)) except: |