diff options
-rw-r--r-- | lcm/pub/utils/toscaparser/vnfdmodel.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lcm/pub/utils/toscaparser/vnfdmodel.py b/lcm/pub/utils/toscaparser/vnfdmodel.py index eac1f0b7..cf29ea68 100644 --- a/lcm/pub/utils/toscaparser/vnfdmodel.py +++ b/lcm/pub/utils/toscaparser/vnfdmodel.py @@ -17,6 +17,7 @@ class EtsiVnfdInfoModel(EtsiNsdInfoModel): tosca.nodetemplates) self.services = self._get_all_services(nodeTemplates) + self.vcloud = self._get_all_vcloud(nodeTemplates) def _get_all_services(self, nodeTemplates): @@ -33,4 +34,24 @@ class EtsiVnfdInfoModel(EtsiNsdInfoModel): service['networks'] = map(lambda x: self.get_requirement_node_name(x), self.getVirtualLinks(node)) ret.append(service) - return ret
\ No newline at end of file + return ret + + def _get_all_vcloud(self, nodeTemplates): + rets = [] + for node in nodeTemplates: + if self._isVcloud(node): + ret = {} + if 'vdc_name' in node['properties']: + ret['vdc_name'] = node['properties']['vdc_name'] + else: + ret['vdc_name'] = "" + if 'storage_clusters' in node['properties']: + ret['storage_clusters'] = node['properties']['storage_clusters'] + else: + ret['storage_clusters'] = [] + + rets.append(ret) + return rets + + def _isVcloud(self, node): + return node['nodeType'].upper().find('.VCLOUD.') >= 0 or node['nodeType'].upper().endswith('.VCLOUD')
\ No newline at end of file |