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...@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@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
_______________________________________________ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack