Cannot pass attribute of resource into the OS::Nova::Server image
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | OpenStack Heat |
Fix Released
|
Medium
|
Oleksii Chuprykov | |
Bug Description
Doing something like:
my_instance:
type: OS::Nova::Server
depends_on: generated_image
properties:
image: { get_attr: [generated_image, value] }
flavor: m1.small
Does not work since the get_attr is not resolved to the real value in the validation step. This means that the validator of OS::Nova::Server will complain about a missing bootable medium.
zaneb confirmed this behaviour on #heat IRC (logs: http://
| Changed in heat: | |
| assignee: | nobody → Oleksii Chuprykov (ochuprykov) |
| Changed in heat: | |
| status: | New → In Progress |
| Changed in heat: | |
| importance: | Undecided → Medium |
| Oleksii Chuprykov (ochuprykov) wrote : | #2 |
I think we can fix this particular situation. In the validation, that precedes to creation of the stack, get_attr resolves to None, and get_resource resolves to None for some resources (e.g. neutron). But further, while accessing the property, we convert None to default value, if it is set in schema, or to "default default", that is '' for strings. We can rely on that '' is correct value, because otherwise it won't pass property validation, that is called before resource plugin validation.
| Changed in heat: | |
| milestone: | none → newton-2 |
cool. I will create a new devstack VM and test my plugin there and see wether it works with your change.
| Changed in heat: | |
| milestone: | newton-2 → newton-3 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: master
commit d995aebb498ecf0
Author: Oleksii Chuprykov <email address hidden>
Date: Wed Jul 6 13:38:58 2016 +0300
Fix empty values validation in nova server
In some places in validation code we assume '' value as
undefined. Howewer, '' means that property is assigned, but
not yet resolved, i.e. get_attr or get_resource function is
used and resolved to None and next in the code, when we get the value
of specific property, we convert None to default value. In this case
to empty string.
Closes-Bug: #1591098
Change-Id: I03a609ce87944c
| Changed in heat: | |
| status: | In Progress → Fix Released |
This issue was fixed in the openstack/heat 7.0.0.0b3 development milestone.


Fix proposed to branch: master /review. openstack. org/338198
Review: https:/