diff options
author | 2017-04-06 18:56:11 +0300 | |
---|---|---|
committer | 2017-04-06 18:56:11 +0300 | |
commit | 9fc2ad8285866c5d45391f9c9f4f49a87a36763a (patch) | |
tree | c36fa770a85d68a5f976051e8c930abb5b1668e3 /jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py | |
parent | 1df0b72a316dcc7f913061706db165d78d2c3a03 (diff) |
[SDC-8] implementing the tosca stubs
Change-Id: Icadc0cc0dadce98e36eaffed0fe551c1387f6f8f
Signed-off-by: Pavel Aharoni <pa0916@att.com>
Diffstat (limited to 'jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py')
-rw-r--r-- | jython-tosca-parser/src/main/resources/Lib/site-packages/tosca_parser-0.7.0-py2.7.egg/toscaparser/tosca_template.py | 14 |
1 files changed, 14 insertions, 0 deletions
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 6b3ea87..c2c3f36 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 @@ -13,6 +13,7 @@ import logging import os +#import shutil from copy import deepcopy from toscaparser.common.exception import ExceptionCollector @@ -73,6 +74,7 @@ class ToscaTemplate(JyToscaTemplate): self.input_path = None self.path = None self.tpl = None + self.csar_tempdir = None self.nested_tosca_tpls_with_topology = {} self.nested_tosca_templates_with_topology = [] if path: @@ -97,6 +99,7 @@ class ToscaTemplate(JyToscaTemplate): self.parsed_params = parsed_params self._validate_field() self.version = self._tpl_version() + self.metadata = self._tpl_metadata() self.relationship_types = self._tpl_relationship_types() self.description = self._tpl_description() self.topology_template = self._topology_template() @@ -109,12 +112,19 @@ class ToscaTemplate(JyToscaTemplate): self._handle_nested_tosca_templates_with_topology() self.graph = ToscaGraph(self.nodetemplates) + if self.csar_tempdir: + #shutil.rmtree(self.csar_tempdir) + csar_tempdir = None + ExceptionCollector.stop() self.verify_template() def getJyVersion(self): return self.version + def getJyMetadata(self): + return self.metadata + def getJyDescription(self): return self.description @@ -146,6 +156,9 @@ class ToscaTemplate(JyToscaTemplate): def _tpl_version(self): return self.tpl.get(DEFINITION_VERSION) + def _tpl_metadata(self): + return self.tpl.get(METADATA) + def _tpl_description(self): desc = self.tpl.get(DESCRIPTION) if desc: @@ -290,6 +303,7 @@ class ToscaTemplate(JyToscaTemplate): if csar.validate(): csar.decompress() self.a_file = True # the file has been decompressed locally + self.csar_tempdir = csar.temp_dir return os.path.join(csar.temp_dir, csar.get_main_template()) else: ExceptionCollector.appendException( |