On Thursday, December 4, 2014 3:01:02 AM UTC-6, Martijn Grendelman 
wrote:Hence the following code in puppetlabs-apache's vhost type:

>
>   # The base class must be included first because it is used by parameter 
> defaults
>   if ! defined(Class['apache']) {
>     fail('You must include the apache base class before using any apache 
> defined resources')
>   }
>  
>


Yuck.  At least that's a relatively benign use of defined(), in that when 
its inherent evaluation-order dependency falls the wrong way the result is 
certain catalog compilation failure (as opposed to a possibly-wrong 
declaration).  That there is a need for this sort of thing at all is a 
function of the mere *existence* of the resource-like class declaration 
syntax.  How I long for the days when you could simply rely on classes' 
singleton nature, so that instead of the above it would be safe simply to 
write "include 'apache'".


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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/87991b2f-56d0-402e-827b-69c573c3a786%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to