TOSCA functions are not supporting complex data extractions

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

Bug Description

In TOSCA simple profile definition there is no mentions that any of node-related functions can't have complex data extraction, for example:

  { get_attribute: [node, attribute, attribute_of_attribute, ...] }

and

  { get_property: [node, property, attribute_of_property, ...] }

But TOSCA parser says that it is not possible to have such function definition.

  File "/Users/denismakogon/Documents/Invader/aio-orchestra/.venv/lib/python3.5/site-packages/toscaparser/tosca_template.py", line 105, in __init__
    self.verify_template()
  File "/Users/denismakogon/Documents/Invader/aio-orchestra/.venv/lib/python3.5/site-packages/toscaparser/tosca_template.py", line 242, in verify_template
    '\n\t'.join(ExceptionCollector.getExceptionsReport()))
toscaparser.common.exception.ValidationError:
The input "/Users/denismakogon/Documents/Invader/aio-orchestra/aio-orchestra-openstack-plugin/examples/orchestra-openstack-authorization.yaml" failed validation with the following error(s):

 ValueError: Illegal arguments for function "get_attribute". Expected arguments: "node-template-name", "attribute-name"

Revision history for this message
Monika (970954-monika) wrote :

As mentioned we have tried to pass complex data extractions and we successfully retrieved the results.
e.g,
{ get_attribute: [server, ports, mac_address] }

The above ValueError mentioned is because of giving less than 2 arguments. We have checked it in “tosca-parser/toscaparser/functions.py” which is as follows:

 def validate(self):
 if len(self.args) < 2:
  ExceptionCollector.appendException(
   ValueError(_('Illegal arguments for function "{0}". Expected '
     'arguments: "node-template-name", "req-or-cap"'
     '(optional), "property name"'
     ).format(GET_ATTRIBUTE)))
  return

So can you please be more specific about the bug.

Revision history for this message
Bob Haddleton (bob-haddleton) wrote :

@Denis - is this still an issue?

Thanks

Bob

Changed in tosca-parser:
status: New → Incomplete
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.