From 6450bd0de59d6551cf9174c6530c2ee97284a1e6 Mon Sep 17 00:00:00 2001 From: hewei-cmss Date: Mon, 17 Jun 2019 19:47:48 +0800 Subject: avoid substitution_mappings key error properties may be not in substitution_mappings. Issue-ID: VFC-1422 Change-Id: I624c1d3e6be51d0d9ce8c3963920f97f0b679256 Signed-off-by: hewei-cmss --- catalog/pub/utils/toscaparser/pnfmodel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog/pub/utils/toscaparser/pnfmodel.py b/catalog/pub/utils/toscaparser/pnfmodel.py index e092e927..9ad86860 100644 --- a/catalog/pub/utils/toscaparser/pnfmodel.py +++ b/catalog/pub/utils/toscaparser/pnfmodel.py @@ -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'] = [] -- cgit 1.2.3-korg