Issue #11158 has been updated by Justin Wood.

I tested myself with Puppet 2.7.6 on Cent6 (and Cent5)...

Basically what is happening overall is that Class["settings"] is internal to 
puppet, and redefining that leads to multiple problems.

class foo {
  include settings
}

doesn't actually load any module settings under 
modules/settings/manifests/init.pp (which is a problem if you expected to have 
defined variables there that you try to reference)

if you define class settings {} at toplevel and import it, you can't use 
extlookup because it fails to find the variables it should have had at toplevel 
in site.pp

Also because its internal to puppet, you can use syntax like:

class foo {
  fail("TEST - $settings::manifestdir - ")
}

without ever including settings anyway, and get that to print out the 
manifestdir value.

Which is why IMO, this should either warn or error out because it can mask 
issues.

Does that help (pokeable on IRC at |Callek|)
----------------------------------------
Bug #11158: redefinition of built-in ‘settings’ class should give warning or 
error
https://projects.puppetlabs.com/issues/11158

Author: Dustin Mitchell
Status: Needs More Information
Priority: Normal
Assignee: Joshua Lifton
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


<pre> 
 [root@relabs-slave tmp]# cat site.pp 
 $extlookup_datadir = "xyz"
 $extlookup_precedence = ["local-settings", "default-settings"]

 import "settings.pp"
 [root@relabs-slave tmp]# cat settings.pp 
 class settings {
        $foo = extlookup("bar")
 }
 [root@relabs-slave tmp]# puppet apply --noop site.pp
 warning: Scope(Class[Settings]): Could not look up qualified variable 
'::extlookup_datadir'; class  has not been evaluated
 warning: Scope(Class[Settings]): Could not look up qualified variable 
'::extlookup_precedence'; class  has not been evaluated
 No match found for 'bar' in any data file during extlookup() at 
/root/tmp/settings.pp:2 on node relabs-slave.build.mtv1.mozilla.com
</pre>

The above follows, roughly, the description in 
http://docs.puppetlabs.com/references/2.6.8/function.html#extlookup -- but 
doesn't work.

We have found that moving the settings class into a module and explicitly 
including it helps.  This points to a problem of trying to evaluate the 
extlookup too early (at parse time?).


-- 
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