Do you like dead threads?  like dead threads....

So, I was looking back over this and there's one thing that we desperately
need as a community.

We need defined(Class['foo']) and it needs to know about ALL classes in the
catalog at compile time, not just the ones that got included before it.

This would save a TON of heartburn in a lot of cases.

For instance, right now, I have to do:

# Don't reverse these two!
include 'foo'
include 'bar'

Where bar has something like:

if defined(Class['foo']) {
  do something that happens if bar has foo
}

In theory, this also rides into unmangling some of the roles/profiles
configurations that I've seen posted around where people twist themselves
in knots using variables to make sure that their classes are included
properly when a simple if defined(Class['foo']) would make all of that
disappear.

I would like to suggest that this get fixed in the future parser and that
it be singled out as something like  'has_class'.

if has_class('foo') { stuff }

Thoughts?

Thanks,

Trevor


On Thu, Feb 20, 2014 at 4:17 AM, Daniele Sluijters <
[email protected]> wrote:

> I like a constrains style solution much better myself to, wasn't aware of
> it at the time.
>
> I think with Puppet 4 we could introduce some additional pain, semver wise
> we'd be
> allowed to do that. If that helped fix this issue once and for all I'm
> pretty sure the
> community would support it too.
>
>
> On Wednesday, 19 February 2014 23:31:24 UTC+1, Markus wrote:
>>
>>
>>
>> > I'm not very fond of the idea of hardwiring special support for
>> > Package resources into Puppet (nor for resources of any other specific
>> > type).  I still like my "constraints" idea, to which Felix directed
>> > your attention, but if something like that is ever implemented then
>> > adopting it will require (smallish) modifications to be made to a lot
>> > of manifests.
>>
>> +1 to a constraints style solution.  Figuring how to do it without
>> causing a lot of widespread minor pain would be an added plus.  :)
>>
>>
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" 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-dev/d680773d-57bb-49e5-9875-f543ace773b0%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
[email protected]

-- This account not approved for unencrypted proprietary information --

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev/CANs%2BFoV3th5f-uHM7wqL6LOPoJf-%2BxWUhB%2BJAAhh7Tua2rA8Pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to