Issue #2309 has been updated by Luke Kanies.

Status changed from Unreviewed to Rejected

I don't know what your template has in it, but I'm pretty sure templates can't 
look up scoped variables.

Instead, copy the variable into your local scope:
<pre>
$dirs = $a::dirs
</pre>
and use that in your template.
----------------------------------------
Bug #2309: templates are processed too early in the compliation
http://projects.reductivelabs.com/issues/2309

Author: Ohad Levy
Status: Rejected
Priority: Normal
Assigned to: 
Category: 
Target version: 
Complexity: Unknown
Affected version: 0.24.8
Keywords: 


it seems that templates ignore variable scopes, consider this code:

<pre>

node default {
    include a
    include b
}

class a {
    $dirs = ""
    dir{["/tmp","/tmp/a","/tmp/b"]: before => File["/tmp/dirs"]}
}
class b {
    file{"/tmp/dirs": content => $a::dirs}
    #file{"/tmp/dirs": content => template("/tmp/dirs.erb")}
}

define dir() {
    $a::dirs += " $name"
    file {$name: ensure => directory }
}
</pre>
using template the output of the file is "", but when dumping the variable 
directly, the content is correct.



-- 
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://reductivelabs.com/redmine/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