Namespace of imported servce template #78
-
I have an ETSI SOL001 VNF Descriptor which imports the ETSI SOL001 vnfd types and subsequently imports a file with some custom types. The custom types are derived from the ETSI SOL001 types. Puccini raises errors that the derived types are not defined.
This yields an error of "reference to unknown node type: tosca.nodes.nfv.Vdu.Compute" I was able to remove this error by adding an import of the ETSI definitions to the custom types.yaml file:
Is this correct behavior or should the ETSI definitions imported in the parent "vnfd" be visible to the child "custom" definitions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is intentional behavior. Every imported file (called a "unit" internally) in Puccini is its own universe. This is necessary in order to maintain proper support of TOSCA namespaces. An imported unit does not know in advance the document into which it may imported and must be fully parsable on its own. Thus, if custom_types.yaml refers to certain types then it must import them explicitly. It cannot reach them from the document into which it is imported. Note that in terms of performance Puccini is very efficient and will internally not parse the same imported unit more than once (as long as its referred to be the same URL or path). By the way, you can dump the import tree with the following command:
|
Beta Was this translation helpful? Give feedback.
This is intentional behavior.
Every imported file (called a "unit" internally) in Puccini is its own universe. This is necessary in order to maintain proper support of TOSCA namespaces. An imported unit does not know in advance the document into which it may imported and must be fully parsable on its own. Thus, if custom_types.yaml refers to certain types then it must import them explicitly. It cannot reach them from the document into which it is imported.
Note that in terms of performance Puccini is very efficient and will internally not parse the same imported unit more than once (as long as its referred to be the same URL or path).
By the way, you can dump the import tree with the foll…