Issue #15741 has been updated by Joe McDonagh.

ok so, after hacking on this code i realized a couple things:

1. The problem resource (being created with create_resource), I was erroneously 
exporting. I removed the export do end part.
2. Changed the parse order of the include as mentioned in the first post so 
that the subclass was included after the resource it required was.
3. the require itself, i had done it in the style of actual puppet code, ie:

:require => Database_user["[email protected]"]

First problem is I needed to put single quotes around it. However, I also 
discovered that having double quotes around the name confused Puppet and made 
it unable to locate the resource... presumably it is doing a simple string 
comparison without stripping first and last quotes.
----------------------------------------
Bug #15741: Ambiguous error message when setting up an invalid requirement in 
the ruby dsl
https://projects.puppetlabs.com/issues/15741#change-67949

Author: Joe McDonagh
Status: Unreviewed
Priority: Normal
Assignee: 
Category: error reporting
Target version: 
Affected Puppet version: 2.7.9
Keywords: errors rubydsl
Branch: 


Say I were to have a regular puppet class called mysql::backup, and in this 
class i 'include' a ruby DSL class called mysql::backup::grants near the top of 
the file... now a few lines after the include statement, i have a resource 
defined we'll call foo... if i require foo inside the ruby dsl class, I get 
this really ambiguous error message:

@@@ text
Jul 31 10:40:06 puppet puppet-master[4656]: Anonymous modules have no name to 
be referenced by at 
/etc/puppet/production/grumps-modules/mysql/manifests/backup.pp:45 on node 
puppet
@@@

Basically I just mucked around til I discovered that if I put the include AFTER 
the resource that I require inside the subclass, it works.


-- 
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 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-bugs?hl=en.

Reply via email to