On Monday, April 13, 2015 at 5:34:15 AM UTC-5, Dan Gibbons wrote:
>
> Hi,
>
> I'm looking at some of our puppet code and trying to keep it clean whilst 
> looking at the puppet 4 deprecation list.
>
> One question I have is regarding inherits;  the docs say that node 
> inheritance is going which we don't use anyway but we do use the params 
> pattern a lot with inherit.
>
> I'm wondering if I should still use inherit for the params or move away to 
> use include instead?
> I presume the inherit keyword its self is not being deprecated?
>
>
You cannot implement the standard params class pattern on top of 
'include'.  The 'include'-family functions (or any other functions) are not 
evaluated soon enough to ensure that class variables of the included class 
are available for use as class parameter defaults for the class wherein the 
'include' appears.  Class inheritance is used in that pattern strictly for 
its side effect of ensuring that the parent class is evaluated before even 
the parameter list of the child class.

To the best of my knowledge, class inheritance is still available in Puppet 
4.  I am inclined to suspect that the wide use of the params class pattern 
is in fact a large part of the reason for that.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d7596ac4-5d63-4f6f-b76d-e410e44f2486%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to