diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2018-03-14 09:10:38 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2018-03-14 09:10:38 +0800 |
commit | b8f06778a798b23fe175bbcb69af84cf0feee50b (patch) | |
tree | cea507a40cb73282c8817b96b9199ed50ded05bf | |
parent | eac7ae75bc674379b60aaa49a653256f82e22a32 (diff) |
Add vfc-catalog UUID non-null protection
For openo csars, there is no UUID, only has id, so when UUID is not null,
replace id with UUID.
Change-Id: I437dbb6dbb2291a223de2981ae830bab46316d37
Issue-ID: VFC-810
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r-- | catalog/pub/utils/toscaparser/basemodel.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/catalog/pub/utils/toscaparser/basemodel.py b/catalog/pub/utils/toscaparser/basemodel.py index 7d2595ad..205bdb4e 100644 --- a/catalog/pub/utils/toscaparser/basemodel.py +++ b/catalog/pub/utils/toscaparser/basemodel.py @@ -161,7 +161,8 @@ class BaseInfoModel(object): def buidMetadata(self, tosca): if 'metadata' in tosca.tpl: self.metadata = copy.deepcopy(tosca.tpl['metadata']) - self.metadata['id'] = tosca.tpl['metadata']['UUID'] + if tosca.tpl['metadata'].get('UUID', ''): + self.metadata['id'] = tosca.tpl['metadata']['UUID'] def buildProperties(self, nodeTemplate, parsed_params): properties = {} |