nested validation requires parameters, but they are not accepted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
Medium
|
Jay Dobies | ||
python-heatclient |
Fix Released
|
Medium
|
Jay Dobies |
Bug Description
The new template-validate --show-nested mode enables validation of more complex structures of templates, however in this mode, validate fails if mandatory paramters aren't provided (normally this is not required for the non-nested mode).
Attempting to pass the parameters fails (unless you put them in an environment file) because heatclient doesn't parse them for template-validate.
[stack@instack tripleo-
[stack@instack tripleo-
usage: heat [--version] [-d] [-v] [--api-timeout API_TIMEOUT]
heat: error: unrecognized arguments: -P OvercloudBlockS
The workaround is to put the parameters into an environment file.
Changed in heat: | |
status: | New → Triaged |
Changed in python-heatclient: | |
status: | New → Triaged |
Changed in heat: | |
importance: | Undecided → Medium |
Changed in python-heatclient: | |
importance: | Undecided → Medium |
Changed in heat: | |
assignee: | nobody → Steven Hardy (shardy) |
Changed in python-heatclient: | |
assignee: | nobody → Steven Hardy (shardy) |
Changed in heat: | |
assignee: | Steven Hardy (shardy) → Jay Dobies (jdob) |
Changed in python-heatclient: | |
assignee: | Steven Hardy (shardy) → Jay Dobies (jdob) |
Changed in python-heatclient: | |
status: | Triaged → In Progress |
Changed in heat: | |
milestone: | none → mitaka-3 |
status: | Fix Committed → Fix Released |
Changed in python-heatclient: | |
status: | Fix Committed → Fix Released |
So, some IRC discussion highlights there are several issues:
1. As reported above, passing required parameters doesn't work unless in an environment file
2. Parameters shouldn't be required anyway, we should tolerate them being missing like in the non-nested case, but I guess end up with "Value": None in the NestedParameters.
3. Parameters passed via referencing an attribute in the parent temlate don't work as expected (there is no "Value" in the NestedParameters", e.g here
https:/ /github. com/openstack/ tripleo- heat-templates/ blob/master/ overcloud. yaml#L1426
we pass blockstorage_ servers: {get_attr: [BlockStorage, attributes, nova_server_ resource] } to AllNodesExtraCo nfig, but in the NestedParameters it looks like this:
"NestedParameters": { AllNodesExtraCo nfig": {
"Description" : "Noop extra config for allnodes extra cluster config\n",
"Parameters" : {
"blockstorag e_servers" : {
"Descripti on": "",
"Label" : "blockstorage_ servers" ,
"NoEcho" : "false",
"
"Type": "Json"
},
Note, no "Value", despite being passed in from the parent, so we need a way to work out a dummy result from the get_attr which will be interpreted as a value for the nested template.
Some cases do work tho, e.g
" AllNodesValidat ionConfig" : {
"Description" : "Software Config to drive validations that occur on all nodes. Note, you need the heat-config-script element built into your images, due to the script group below.\n",
"Parameters" : {
"PingTestIps ": {
"Default" : "",
"Descripti on": "A string containing a space separated list of IP addresses used to ping test each available network interface.",
"Label" : "PingTestIps",
"NoEcho" : "false",
"Value" : " "
"Type": "String",
}
},
Here we can see the output of the list_join passing through OK, presumably because it doesn't evaluate to None.
Examples above are from validation of tripleo- heat-templates.