-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oh...I'm also still using 0.24.9, so that could be it.
Trevor
On 01/26/2011 02:23 PM, Trevor Vaughan wrote:
> Nick,
>
> Here's what I used to try it:
>
> #class foo {
> # notify { "blah": }
> #}
>
> #if defined( Class["foo"] ) {
> # notify { "found_foo": }
> #}
>
> #$foo = "blah2"
>
> if defined( "foo" ) {
> notify { "found_foo2": }
> }
>
> $bar = "blah"
>
> if defined( "bar" ) {
> notify { "found_bar": }
> }
>
> At this state, you should get 'found_bar' and that's it.
>
> If you uncomment either the class or the 'foo' variable, you should get
> 'found_foo2'.
>
> If you uncomment both the class *and* the 'foo' variable, you should get
> 'found_foo2'.
>
> Trevor
>
> On 01/26/2011 02:19 PM, Nick Fagerlund wrote:
>> Hi, Trevor!
>
>> On Jan 26, 7:32 am, Trevor Vaughan <[email protected]> wrote:
>>> Maybe I'm missing something here.
>>>
>>> class foo { ... }
>>>
>>> and
>>>
>>> $foo
>>>
>>> Both trigger: defined('foo')
>
>> I cannot for the life of me get this to work on either 2.6.4 or
>> 0.25.5. This code:
>
>> $somevar = "var."
>
>> notice('$somevar defined?')
>> notice(defined($somevar))
>> notice('')
>
>> notice('somevar defined?')
>> notice(defined(somevar))
>> notice('')
>
>> notice('"$somevar" defined?')
>> notice(defined("$somevar"))
>> notice('')
>
>> notice('\'$somevar\' defined?')
>> notice(defined('$somevar'))
>> notice('')
>
>> notice('"somevar" defined?')
>> notice(defined("somevar"))
>> notice('')
>
>> notice('\'somevar\' defined?')
>> notice(defined('somevar'))
>
>
>> ... gives me a whole pile of "false;" as far as I could determine,
>> defined() ignores variables. Could you get me some more info on how
>> you got that to happen?
>
>> Thanks,
>> N
>
>
- --
Trevor Vaughan
Vice President, Onyx Point, Inc.
email: [email protected]
phone: 410-541-ONYX (6699)
pgp: 0x6C701E94
- -- This account not approved for unencrypted sensitive information --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEcBAEBAgAGBQJNQHZUAAoJECNCGV1OLcyp380H/RRmtIIWkBYynOIZChS/WqDA
UcN8LFTGTro4zagvQyquGi3rgW5MnmFmzY7wHrfUWGR95pmn8/W5ah/eyj6hPgFc
CwXh25FffyWWp5z9OqKR114PPfspbG6/cNwB0TaY+HZJIQiXSpoZyJfj0QQzYDi7
7ozQYzkXCQxBnzBERHyqVEVfkx/fcecagJ2Ufi2TVmGD7ffVGCCd8js1PB06gdQL
FCgR0rAlwWoIM+qIQfyxp5TJA4rsepAdr7bGO/4+HAJU3tlzhHG0j3KACng6P3Yp
HhSyWDFmZSY1Qsjem0/FjNkkq3gMrf6QplBeHqoJvqG2kqp5M9w0I0Gmpkr8td0=
=CvJX
-----END PGP SIGNATURE-----
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.
<<attachment: tvaughan.vcf>>
