Issue #2680 has been updated by Luke Kanies. Category changed from unknown to parser Status changed from Unreviewed to Needs more information
I definitely agree that this should work the way you expect, and I thought it was. I'm a bit confused by your second code chunk, though -- does that actually work? I would expect it to behave exactly the same; have you verified it doesn't? ---------------------------------------- Bug #2680: Template Content in Inherited Class Resource http://projects.reductivelabs.com/issues/2680 Author: Brad Krane Status: Needs more information Priority: Normal Assigned to: Category: parser Target version: Affected version: 0.24.8 Keywords: template overload Branch: Hi, I have discovered an odd behavior of the content generation of the template function in an inherited class with an overloaded variable. For example: <pre> class webapp { $dbname = "webapp" file{ "config.php": content => template("webapp/config.php.erb") } } class dev-webapp inherits webapp { $dbname = "dev-webapp" File["config.php"] { content => template("webapp/config.php.erb") } } </pre> where config.php.erb contains: <pre> database = <%= dbname %> </pre> I would expect that content of the dev-webapp version of config.php to be "database = dev-webapp" however it is "database = webapp" as if the value of $dbname was never changed from the base class. In order to get the output I would expect I have to declare the child class as follows: <pre> class dev-webapp inherits webapp { $dbname = "dev-webapp" $filecontent = template("webapp/config.php.erb") File["config.php"] { content => $filecontent } } </pre> To me it seems that the two different versions of the dev-webapp class should yield the same output for the content. -- 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 -~----------~----~----~----~------~----~------~--~---
