diff --git a/tosca_parser.py b/tosca_parser.py index b726b77..513c187 100644 --- a/tosca_parser.py +++ b/tosca_parser.py @@ -57,7 +57,7 @@ def main(): def parse(path, a_file=True): output = None - tosca = ToscaTemplate(path, a_file) + tosca = ToscaTemplate(path, None, a_file) version = tosca.version if tosca.version: print ("\nversion:\n" + version) diff --git a/toscaparser/tests/test_toscatpl.py b/toscaparser/tests/test_toscatpl.py index 4c61023..fe4881f 100644 --- a/toscaparser/tests/test_toscatpl.py +++ b/toscaparser/tests/test_toscatpl.py @@ -402,7 +402,7 @@ class ToscaTemplateTest(TestCase): tosca_tpl = ('https://raw.githubusercontent.com/openstack/' 'tosca-parser/master/toscaparser/tests/data/' 'tosca_single_instance_wordpress.yaml') - tosca = ToscaTemplate(tosca_tpl, False) + tosca = ToscaTemplate(tosca_tpl, None, False) self.assertTrue(tosca.topology_template.custom_defs) def test_url_template_with_local_abspath_import(self): @@ -410,7 +410,8 @@ class ToscaTemplateTest(TestCase): 'tosca-parser/master/toscaparser/tests/data/' 'tosca_single_instance_wordpress_with_local_abspath_' 'import.yaml') - err = self.assertRaises(ImportError, ToscaTemplate, tosca_tpl, False) + err = self.assertRaises(ImportError, ToscaTemplate, tosca_tpl, + None, False) err_msg = (_("Absolute file name /toscaparser/tests/data/custom_types" "/wordpress.yaml cannot be used for a URL-based input " "%(tpl)s template.") @@ -421,7 +422,7 @@ class ToscaTemplateTest(TestCase): tosca_tpl = ('https://raw.githubusercontent.com/openstack/' 'tosca-parser/master/toscaparser/tests/data/' 'tosca_single_instance_wordpress_with_url_import.yaml') - tosca = ToscaTemplate(tosca_tpl, False) + tosca = ToscaTemplate(tosca_tpl, None, False) self.assertTrue(tosca.topology_template.custom_defs) def test_csar_parsing_wordpress(self): @@ -433,4 +434,4 @@ class ToscaTemplateTest(TestCase): def test_csar_parsing_elk_url_based(self): csar_archive = ('https://github.com/openstack/tosca-parser/raw/master/' 'toscaparser/tests/data/CSAR/csar_elk.zip') - self.assertTrue(ToscaTemplate(csar_archive, False)) + self.assertTrue(ToscaTemplate(csar_archive, None, False)) diff --git a/toscaparser/tosca_template.py b/toscaparser/tosca_template.py index d0fb740..d01b67d 100644 --- a/toscaparser/tosca_template.py +++ b/toscaparser/tosca_template.py @@ -48,7 +48,7 @@ class ToscaTemplate(object): VALID_TEMPLATE_VERSIONS = ['tosca_simple_yaml_1_0'] '''Load the template data.''' - def __init__(self, path, a_file=True, parsed_params=None): + def __init__(self, path, parsed_params=None, a_file=True): self.a_file = a_file self.path = self._get_path(path) self.tpl = YAML_LOADER(self.path, self.a_file)