diff options
author | Pavel Aharoni <pa0916@att.com> | 2017-03-29 18:56:08 +0300 |
---|---|---|
committer | Pavel Aharoni <pa0916@att.com> | 2017-03-29 18:56:43 +0300 |
commit | 905dce200dd3cf37bfc3b444a0d70b57232a30dc (patch) | |
tree | 3e4aad46e17d6daec871568fea3459a45c0034ec /jython-tosca-parser/src/main/resources/Lib | |
parent | 611df70a00b75c1107b858e6904dc402d3fdff17 (diff) |
[SDC-7] jython tosca parser 0.4.0-SNAPSHOT
Change-Id: I838b10721cfdf5b714e14f56fdae4c3c6d51445b
Signed-off-by: Pavel Aharoni <pa0916@att.com>
Diffstat (limited to 'jython-tosca-parser/src/main/resources/Lib')
3 files changed, 27 insertions, 5 deletions
diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/nodetemplate.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/nodetemplate.py index 6f37dfb..ee7622c 100644 --- a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/nodetemplate.py +++ b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/nodetemplate.py @@ -30,6 +30,7 @@ from toscaparser.elements.relationshiptype import RelationshipType from toscaparser.entity_template import EntityTemplate from toscaparser.relationship_template import RelationshipTemplate from toscaparser.utils.gettextutils import _ +from toscaparser.utils import validateutils from org.openecomp.sdc.toscaparser.jython import JyNodeTemplate log = logging.getLogger('tosca') @@ -39,11 +40,12 @@ class NodeTemplate(EntityTemplate, JyNodeTemplate): '''Node template from a Tosca profile.''' def __init__(self, name, node_templates, custom_def=None, available_rel_tpls=None, available_rel_types=None): - super(NodeTemplate, self).__init__(name, node_templates[name], + nodeTemplate = node_templates[name] + super(NodeTemplate, self).__init__(name, nodeTemplate, 'node_type', custom_def) self.templates = node_templates - self._validate_fields(node_templates[name]) + self._validate_fields(nodeTemplate) self.custom_def = custom_def self.related = {} self.relationship_tpl = [] @@ -51,6 +53,13 @@ class NodeTemplate(EntityTemplate, JyNodeTemplate): self.available_rel_types = available_rel_types self._relationships = {} self.sub_mapping_tosca_template = None + self.meta_data = None + if self.METADATA in nodeTemplate: + self.meta_data = nodeTemplate.get(self.METADATA) + validateutils.validate_map(self.meta_data) + + def getJyMetadata(self): + return self.meta_data @property def relationships(self): diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/prereq/csar.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/prereq/csar.py index 36f39cc..de98328 100644 --- a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/prereq/csar.py +++ b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/prereq/csar.py @@ -251,7 +251,12 @@ class CSAR(object): operation['implementation']) finally: if self.temp_dir: - shutil.rmtree(self.temp_dir) + shutil.rmtree(self.temp_dir, False, self._printPath) + + + def _printPath(self, func, path, exc_info): + print('Could not delete: ' + path) + def _validate_external_reference(self, tpl_file, resource_file, raise_exc=True): diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/topology_template.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/topology_template.py index 23f544a..c56e7b9 100644 --- a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/topology_template.py +++ b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/topology_template.py @@ -25,16 +25,17 @@ from toscaparser.relationship_template import RelationshipTemplate from toscaparser.substitution_mappings import SubstitutionMappings from toscaparser.tpl_relationship_graph import ToscaGraph from toscaparser.utils.gettextutils import _ +from toscaparser.utils import validateutils from org.openecomp.sdc.toscaparser.jython import JyTopologyTemplate # Topology template key names SECTIONS = (DESCRIPTION, INPUTS, NODE_TEMPLATES, RELATIONSHIP_TEMPLATES, OUTPUTS, GROUPS, - SUBSTITUION_MAPPINGS, POLICIES) = \ + SUBSTITUION_MAPPINGS, POLICIES, METADATA) = \ ('description', 'inputs', 'node_templates', 'relationship_templates', 'outputs', 'groups', - 'substitution_mappings', 'policies') + 'substitution_mappings', 'policies', 'metadata') log = logging.getLogger("tosca.model") @@ -48,6 +49,10 @@ class TopologyTemplate(JyTopologyTemplate): self.tpl = template self.sub_mapped_node_template = sub_mapped_node_template if self.tpl: + self.meta_data = None + if METADATA in self.tpl: + self.meta_data = self.tpl.get(METADATA) + validateutils.validate_map(self.meta_data) self.custom_defs = custom_defs self.rel_types = rel_types self.parsed_params = parsed_params @@ -78,6 +83,9 @@ class TopologyTemplate(JyTopologyTemplate): def getJySubstitutionMappings(self): return self.substitution_mappings + + def getJyMetadata(self): + return self.meta_data def _inputs(self): inputs = [] |