I just noticed last night we can now access resource and class attributes:

   define x($y) { 
   }

   x{"foo": y => "bar"}

   notice(X["foo"]["y"])

this works, yay with the obvious parsing order caveats.

This works too:

   define x($y) {
    notify{$name: message =>  $y }
   }

   class one {
     x{"one": y => "hello from one"}
   }

   include one

   notice(X["one"]["y"])

but this does not:

    define x($y) {
      notify{$name: message =>  $y }
    }

    x{"hello": y => "hello world"}

    notify{"outside": message => "hello from outside"}

    notify{X["hello"]["y"]: }
    notify{Notify["outside"]["message"]: } # works
    notify{Notify["hello"]["message"]: } # fails

It can't find the notify inside the defined type X:

Error: Evaluation Error: Resource not found: Notify['hello']

commenting out the problem notify I do see:

Notice: /Stage[main]/Main/X[hello]/Notify[hello]/message: defined 'message' as 
'hello world'

which suggests I didn't mess up the resource name

Is this a bug or just not supposed to work?

---
R.I.Pienaar

-- 
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/788118997.92258.1438338939924.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to