Fix lcm vnf parameter reported to aai 55/21755/1
authorying.yunlong <ying.yunlong@zte.com.cn>
Thu, 2 Nov 2017 02:25:16 +0000 (10:25 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Thu, 2 Nov 2017 02:25:16 +0000 (10:25 +0800)
Change-Id: I1cbf33998a1fc4821527c562a9813c15bf494145
Issue-ID: VFC-558
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
lcm/ns/vnfs/create_vnfs.py

index ede3380..0f3e57d 100644 (file)
@@ -279,6 +279,9 @@ class CreateVnfs(Thread):
     def create_vnf_in_aai(self):
         logger.debug("CreateVnfs::create_vnf_in_aai::report vnf instance[%s] to aai." % self.nf_inst_id)
         try:
+            ns_insts = NSInstModel.objects.filter(id=self.ns_inst_id)
+            self.global_customer_id = ns_insts[0].global_customer_id
+            self.service_type = ns_insts[0].service_type
             data = {
                 "vnf-id": self.nf_inst_id,
                 "vnf-name": self.vnf_inst_name,
@@ -293,11 +296,11 @@ class CreateVnfs(Thread):
                             "relationship-data": [
                                 {
                                     "relationship-key": "customer.global-customer-id",
-                                    "relationship-value": "global-customer-id-" + self.ns_inst_id
+                                    "relationship-value": self.global_customer_id
                                 },
                                 {
                                     "relationship-key": "service-subscription.service-type",
-                                    "relationship-value": "Network"
+                                    "relationship-value": self.service_type
                                 },
                                 {
                                     "relationship-key": "service-instance.service-instance-id",