Why are there 3 different intrinsic functions get_* instead of one single unified one?

asked 2017-09-21 07:07:09 -0600

felixfiskare gravatar image

updated 2017-09-25 09:17:49 -0600

I'm wondering why there are three separate intrinsic functions to get information inside a HEAT template (get_param, get_resource & get_attr).

  • Why isn't there one function (just get for example) which covers all three use cases?
  • What are the benefits of having to address parameters, resources and attributes with different functions?

The only reason I came up with is that you can use one name multiple times (once as a parameter name, once as a resource name and so on)m but I don't think that's a good reason. Can someone enlighten me?

Reasons for one function "get", instead of "get_param, "get_resource" & "get_attribute":

  • easier to learn and remember, only one name instead of three
  • less error prone, because stuff "just works" instead of having to remember arbitrary differences and their respective function call ( additionally, heat error messages hide the real reason quite well )
  • easier to copy&paste from different scripts. I could copy a get_resource call and would only have to add the resource identifer instead of the resource identifier AND the function call
  • KISS: Why make things more complicated than they have to be?

What are advantages of this more complicated, more difficult solution?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-09-25 08:45:21 -0600

zaneb gravatar image

Because they do different things? Why do you need another reason?

edit flag offensive delete link more


In general, I like to have reasons for a decision. I extended my questions to answer your's.

felixfiskare gravatar imagefelixfiskare ( 2017-09-25 09:18:24 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-09-21 07:06:24 -0600

Seen: 77 times

Last updated: Sep 25 '17