TOSCA parser fails to load parsed template dict from another template

Bug #1594781 reported by Denis Makogon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
TOSCA Parser
New
Undecided
Denis Makogon

Bug Description

Assume you want to create two identical templates instances but use two different inputs for them, and you don't want to provide path to template file but use previous template instance attribute - *.tpl

Here's code example:

    path = ('/tmp/orchestra-openstack-authorization.yaml')
    _tmplt = tosca_template.ToscaTemplate(
        path=path, parsed_params=None,
        a_file=True, yaml_dict_tpl=None)
    print(_tmplt.tpl)

    _tmplt_2 = tosca_template.ToscaTemplate(
        path=None, parsed_params=None, a_file=False,
        yaml_dict_tpl=_tmplt.tpl
    )
    print(_tmplt_2.tpl)

Second template creation fails with an error:

  File "/Users/denismakogon/Documents/Invader/aio-orchestra/.venv/lib/python3.5/site-packages/toscaparser/tosca_template.py", line 96, in __init__
    self.topology_template = self._topology_template()
  File "/Users/denismakogon/Documents/Invader/aio-orchestra/.venv/lib/python3.5/site-packages/toscaparser/tosca_template.py", line 111, in _topology_template
    self.parsed_params)
  File "/Users/denismakogon/Documents/Invader/aio-orchestra/.venv/lib/python3.5/site-packages/toscaparser/topology_template.py", line 60, in __init__
    self._process_intrinsic_functions()
  File "/Users/denismakogon/Documents/Invader/aio-orchestra/.venv/lib/python3.5/site-packages/toscaparser/topology_template.py", line 274, in _process_intrinsic_functions
    func = functions.get_function(self, self.outputs, output.value)
  File "/Users/denismakogon/Documents/Invader/aio-orchestra/.venv/lib/python3.5/site-packages/toscaparser/functions.py", line 594, in get_function
    func_name = list(raw_function.keys())[0]
AttributeError: 'GetAttribute' object has no attribute 'keys'

Changed in tosca-parser:
assignee: nobody → Denis Makogon (lildee1991)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.