avoid substitution_mappings key error 02/90002/1
authorhewei-cmss <hewei@cmss.chinamobile.com>
Mon, 17 Jun 2019 11:47:48 +0000 (19:47 +0800)
committerhewei-cmss <hewei@cmss.chinamobile.com>
Mon, 17 Jun 2019 11:47:48 +0000 (19:47 +0800)
properties may be not in substitution_mappings.

Issue-ID: VFC-1422

Change-Id: I624c1d3e6be51d0d9ce8c3963920f97f0b679256
Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com>
catalog/pub/utils/toscaparser/pnfmodel.py

index e092e92..9ad8686 100644 (file)
@@ -37,7 +37,7 @@ class PnfdInfoModel(BaseInfoModel):
         pnf_substitution_mappings = tosca.tpl['topology_template'].get('substitution_mappings', None)
         if pnf_substitution_mappings:
             self.pnf['type'] = pnf_substitution_mappings['node_type']
-            self.pnf['properties'] = pnf_substitution_mappings['properties']
+            self.pnf['properties'] = pnf_substitution_mappings.get('properties', {})
 
     def get_all_cp(self, nodeTemplates):
         self.pnf['ExtPorts'] = []