From: hewei-cmss Date: Mon, 17 Jun 2019 11:47:48 +0000 (+0800) Subject: avoid substitution_mappings key error X-Git-Tag: 1.3.4~17 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F90002%2F1;p=vfc%2Fnfvo%2Fcatalog.git avoid substitution_mappings key error properties may be not in substitution_mappings. Issue-ID: VFC-1422 Change-Id: I624c1d3e6be51d0d9ce8c3963920f97f0b679256 Signed-off-by: hewei-cmss --- 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'] = []