summaryrefslogtreecommitdiffstats
path: root/jython-tosca-parser/src/main/resources/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'jython-tosca-parser/src/main/resources/Lib')
-rw-r--r--jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/nodetemplate.py13
-rw-r--r--jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/parameters.py5
-rw-r--r--jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/prereq/csar.py7
-rw-r--r--jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/topology_template.py12
-rw-r--r--jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py5
5 files changed, 35 insertions, 7 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/parameters.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/parameters.py
index 7a4acd9..1bb58be 100644
--- a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/parameters.py
+++ b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/parameters.py
@@ -50,7 +50,10 @@ class Input(JyInput):
return self.required
def getJyDescription(self):
- return self.description
+ return self.description
+
+ def getJyDefault(self):
+ return self.default
@property
def type(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 = []
diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py
index 55485f0..6b3ea87 100644
--- a/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py
+++ b/jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py
@@ -119,8 +119,11 @@ class ToscaTemplate(JyToscaTemplate):
return self.description
def getJyTopologyTemplate(self):
- return self.topology_template
+ return self.topology_template
+ def getJyNestedTopologyTemplates(self):
+ return self.nested_tosca_templates_with_topology
+
def _topology_template(self):
return TopologyTemplate(self._tpl_topology_template(),
self._get_all_custom_defs(),