[openstack-dev] [Heat] New function: first_nonnull

Fox, Kevin M Kevin.Fox at pnnl.gov
Wed Nov 5 16:39:30 UTC 2014


That would be very useful. It would eliminate a few more places where I've needed the aws if function.

It would be good to keep the get_ prefix for consistency.

Id vote for seperate function. Its cleaner.

Thanks,
Kevin

________________________________
From: Lee, Alexis
Sent: Wednesday, November 05, 2014 6:46:43 AM
To: OpenStack Development Mailing List (not for usage questions)
Subject: [openstack-dev] [Heat] New function: first_nonnull

I’m considering adding a function which takes a list and returns the first
non-null, non-empty value in that list.

So you could do EG:

    some_thing:
        config:
            ControlVIP:
                first_nonnull:
                - {get_param: ControlVIP}
                - {get_attr: [ControlVirtualIP, fixed_ips, 0, ip_address]}]}

I’m open to other names, EG “some”, “or”, “fallback_list” etc.

Steve Hardy suggested building this into get_attr or Fn::Select. My feeling
is that those each do one job well right now, I’m happy to take a steer
though.

What do you think please?


Alexis (lxsli)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20141105/0335786a/attachment.html>


More information about the OpenStack-dev mailing list