Provide support for TOSCA qualified name

Bug #1452546 reported by Sahdev Zala
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Heat Translator
New
High
SREELAKSHMI PENTA

Bug Description

In a TOSCA template, TOSCA entities can be provided as,
1. Full name e.g. tosca.nodes.Compute
2. Short name e.g. Compute
3. Qualified name e.g. tosca:Compute

The current implementation supports Full and Short name, the qualified name should be implemented the same way.

Revision history for this message
Dimitri Mazmanov (sorantis) wrote :

Looking at translator/hot/translate_node_templates.py
It seems that this aliasing could be achieved by using multi-key dicts such as https://pypi.python.org/pypi/multi_key_dict/ or any custom multi key dict.
e.g.

TOSCA_TO_HOT_TYPE['tosca.nodes.Compute', 'Compute', 'tosca:Compute'] = ToscaCompute
TOSCA_TO_HOT_TYPE['tosca.nodes.network.Network', 'Network', 'tosca:Network'] = ToscaNetwork

Revision history for this message
Dimitri Mazmanov (sorantis) wrote :

This dict will also allow using the following construct:

Instead of
if node.type == "tosca.nodes.Compute":
have
if node.type in TOSCA_TO_HOT_TYPE.get_other_keys("tosca.nodes.Compute", True):

Revision history for this message
Matt Rutkowski (mrutkows) wrote :

Before anyone works on this... I am formalizing how we do namespacing and namespace prefixing in the latest TOSCA spec. As part of that work, I am planning on formalizing the "shortname" and "prefix" used on the qualified name. Whoever Implements this should schedule a call with Sahdev and myself to be sure all the implications are well understood before starting.

Revision history for this message
Matt Rutkowski (mrutkows) wrote :

For "shortname" my plan is to add a an "sname" keyname to all base TOSCA types (i.e., Node, Relationship, Artifact, Capability, Interface, etc.) that will declare the value in the spec. so it is not something "just in the spec. text" but actually in the TOSCA definition schema file.

Revision history for this message
Sahdev Zala (spzala) wrote :

Hi Dimitri,

I think we need to do more than just modifying translator side code (e.g. translator/hot/translate_node_templates.py) as this needs to be taken care in TOSCA Parse (toscalib dir) code as well.

As Matt mentioned how to handle namespace is under discussion, let's wait on it before we finalize any implementation. Thanks!

Sahdev Zala (spzala)
Changed in heat-translator:
importance: Undecided → High
Changed in heat-translator:
assignee: nobody → Hansel Thomas (hansel.thomas)
Changed in heat-translator:
assignee: Hansel Thomas (hansel.thomas) → SREELAKSHMI PENTA (sreelakshmi-penta)
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.