Neutron port resource fails to validate empty string
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Invalid
|
Medium
|
Unassigned |
Bug Description
If you do this, the stack validation doesn't reject the empty string, and the create fails in a non-obvious way:
heat_template_
parameters:
net:
type: string
default: ""
resources:
port:
type: OS::Neutron::Port
properties:
network_id: {get_param: net}
| stack_status | CREATE_FAILED |
| stack_status_reason | Resource CREATE failed: BadRequest: resources.port: |
| | Unrecognized attribute(s) 'network'
In the engine log there's a backtrace where we've tried to pass the wrong "network" key with an empty string to neutron, instead of validating the network_id is invalid, which is fairly confusing when the empty string has been passed in via a user parameter or via a parent stack etc.
Changed in heat: | |
status: | New → Triaged |
importance: | Undecided → Medium |
milestone: | none → mitaka-2 |
Changed in heat: | |
status: | Triaged → Invalid |
It seems, it is correct behaviour. If you pass an invalid network id/name also, the stack will fail.
If we want to validate an empty string, have to add constraints in the parameter.