Issue #5074 has been updated by Markus Roberts.

Status changed from Unreviewed to Rejected

This is correct behaviour; since the value of the variables could depend on the 
parameters, there's no way to know their values unless the class is 
instantiated.  In this particular case (where there are no parameters and the 
value is a constant) it seems like a silly restriction, but the code has to 
work for the general case even if it could in theory do something "smarter" in 
a special case.

----------------------------------------
Bug #5074: declaring a parameterized class does not make its enclosed variables 
accessible
https://projects.puppetlabs.com/issues/5074

Author: Dan Bode
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.6.3rc1
Keywords: include class parameterized scope
Branch: 


The following code
<pre>
class { 'motd':
  override_data => 'override'
}
notice($motd::override_data)
</pre>
results in:
<pre>
warning: Scope(Class[main]): Could not look up qualified variable 
'motd::override_data'; class motd has not been evaluated
notice: Scope(Class[main]):
</pre>

I can fix this, by putting an include before I want to use the qualified 
variable.

<pre>
class { 'motd':
  override_data => 'override'
}
include motd
notice($motd::local_var)
</pre>

<pre>
notice: Scope(Class[main]): override
</pre>





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