Closed philippemerle closed 2 years ago
The issue is your use of --coerce
: it indeed tries to call all functions, and it's indeed a problem with attributes that do not have default values. This is by design, and it's the reason that --coerce
is not the default.
Attributes are out of the scope of Puccini itself, as it's just a frontend for TOSCA. A complete system could work like this:
puccini-tosca compile
to create a Clout (no --coerce
)puccini-clout scriptlet exec tosca.coerce
on the Clout, whenever you want, to see all current values(It is also possible for a system to incorporate Puccini as a library and manage Clout in a different way. The puccini-clout
tool is not the only way. Even more: a system does not have have to use Puccini for this. Because all the functions are written in JavaScript, it may be possible to support Clout with a different implementation other than Puccini.)
By the way, this is discussed in the tutorial in this and the following section. Please provide feedback if you think the description is not clear enough!
Thank you for your explanation.
Following is a simplified version of an ETSI NFV SOL001 example:
Compiling this template with puccini 0.21.1 produces a problem:
scale_status
is a declared attribute ofSunshineDB
node template, and is a map with string keys and integer entries.Until the execution, it is impossible to check that the
scale_status
map contains thecall_proc
key.But a TOSCA parser should only check that
call_proc
is of type string (else this is a typing error) and that the type of the get_attribute expression (hereinteger
) is compatible with the type of the assigned attribute (hereinteger
), else this is a typing error. So we could expect that this template should not be rejected by any TOSCA parser/compiler.Am I missing something on this example?