Fix create vnfs bug
[vfc/nfvo/lcm.git] / lcm / ns_vnfs / biz / create_vnfs.py
index a901f15..3e98471 100644 (file)
@@ -262,7 +262,8 @@ class CreateVnfs(Thread):
             # identifiers.append(vim_info[1])
             # cloudOwner = vim_info[0]
             identifiers = list()
-            self.vim_id = json.loads(self.vim_id)
+            if type(self.vim_id) == str:
+                self.vim_id = json.loads(self.vim_id)
             identifiers.append(self.vim_id['cloud_regionid'])
             cloudOwner = self.vim_id['cloud_owner']
             required_candidate = [
@@ -400,6 +401,8 @@ class CreateVnfs(Thread):
         }
         try:
             SubscriptionCreation(data).do_biz()
+        except NSLCMException as e:
+            logger.error("subscribe failed: %s", e.args[0])
         except Exception as e:
             logger.error("subscribe failed: %s", e.args[0])