Issue #21441 has been reported by Thomas Bellman.

----------------------------------------
Bug #21441: Resource defaults for class-local define requires fully qualified 
name
https://projects.puppetlabs.com/issues/21441

* Author: Thomas Bellman
* Status: Unreviewed
* Priority: Low
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 2.7.22
* Keywords: 
* Branch: 
----------------------------------------
If I have a defined resource type inside a class, I can refer to that using 
just the unqualified name.  But not for setting defaults for that defined type.

Here is a simple manifest showing the problem:

  class foo
  {
      define bar($message, $withpath)
      {
          notify { $name: message => $message, withpath => $withpath; }
      }

      Bar { withpath => true }
      bar { 1: message => 'Message 1'; }
  }

  node default { include foo }


Running this gives:

$ puppet apply /tmp/test.pp 
Must pass withpath to Foo::Bar[1] at /tmp/test.pp:3 on node jolokia

If i change line 8 to

      Foo::Bar { withpath => true }

it works as I expect it to.

Not a high priority bug, as there is a simple workaround, but it took
me some time to figure out what was happening...

I have only tested this against 2.7.22 and 2.6.18 (I found it when I
updated from 2.6.18 to 2.7.22 and started to try to exterminate warnings
about dynamic scoping).


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to