Create ns/vnf/vserver relationship
[vfc/nfvo/lcm.git] / lcm / ns / ns_create.py
index a80bf8d..ff50107 100644 (file)
@@ -14,6 +14,7 @@
 import logging
 import uuid
 
+from lcm.pub.config.config import REPORT_TO_AAI
 from lcm.pub.database.models import NSDModel, NSInstModel
 from lcm.pub.exceptions import NSLCMException
 from lcm.pub.msapi.aai import create_customer_aai
@@ -34,7 +35,8 @@ class CreateNSService(object):
         self.check_nsd_valid()
         self.check_ns_inst_name_exist()
         self.create_ns_inst()
-        self.create_ns_in_aai()
+        if REPORT_TO_AAI:
+            self.create_ns_in_aai()
         logger.debug("CreateNSService::do_biz::ns_inst_id=%s" % self.ns_inst_id)
         return self.ns_inst_id
 
@@ -86,6 +88,6 @@ class CreateNSService(object):
         }
         resp_data, resp_status = create_customer_aai(global_customer_id, data)
         if resp_data:
-            logger.debug("Fail to create ns instance[%s] to aai, resp_status: [%s]." % (self.ns_inst_id, resp_status) )
+            logger.debug("Fail to create ns[%s] to aai: [%s].", self.ns_inst_id, resp_status)
         else:
-            logger.debug("Success to create ns instance[%s] to aai, resp_status: [%s]." % (self.ns_inst_id, resp_status) )
+            logger.debug("Success to create ns[%s] to aai: [%s].", self.ns_inst_id, resp_status)