[Openstack] [HEAT] order in attributes list

Pavlo Shchelokovskyy pshchelokovskyy at mirantis.com
Wed Apr 4 08:46:30 UTC 2018


Hi,

AFAIU the get_attr function does not use the values you've passed to Heat
in the resource definition, instead it fetches their actual values from
Neutron (basically making a 'port show' API call), and Heat does nothing
wrt to ordering afterwards.

Btw AFAIR this is exactly why heat requires a separate network with single
IPv4 subnet during tempest tests - the default network created by devstack
at some point started to have both IPv4 and IPv6 subnets, and there's no
way I know of to get specifically the IPv4 address using get_attr.

OTOH may be some newer Heat template features like map filters,
conditionals and yaql expressions could possibly be utilized for that..
need to investigate :-)

Cheers,

On Tue, Apr 3, 2018 at 6:10 PM, Volodymyr Litovka <doka.ua at gmx.com> wrote:

> Hi colleagues,
>
> I have the following HOT configuration of a port:
>
>   n1-wan:
>     type: OS::Neutron::Port
>     properties:
>       fixed_ips:
>         - { subnet: e-subnet1, ip_address: 51.x.x.x }
>         - { subnet: e-subnet2, ip_address: 25.x.x.x }
>
> when I try to extract these values in template using {get_attr}, then,
> regardless of fixed_ips' order in port definition (either "subnet1,
> subnet2" or "subnet2, subnet1"), the value of { get_attr: [n1-wan,
> fixed_ips] } always give the following result:
>
> output_value:
>    - ip_address: 25.x.x.x
>       subnet_id: ...
>    - ip_address: 51.x.x.x
>      subnet_id: ...
>
> and, thus, { get_attr: [n1-wan, fixed_ips, 1, ip_address ] } gives me
> 51.x.x.x value.
>
> So, the question is - how the list of fixed_ips is ordered? Is there way
> to know for sure index of entry I'm interested in?
>
> Thank you.
>
> --
> Volodymyr Litovka
>   "Vision without Execution is Hallucination." -- Thomas Edison
>
>
> _______________________________________________
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstac
> k
> Post to     : openstack at lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstac
> k
>



-- 
Dr. Pavlo Shchelokovskyy
Senior Software Engineer
Mirantis Inc
www.mirantis.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20180404/4b98cc1e/attachment.html>


More information about the Openstack mailing list