Issue #2680 has been reported by Brad Krane.

----------------------------------------
Bug #2680: Template Content in Inherited Class Resource
http://projects.reductivelabs.com/issues/2680

Author: Brad Krane
Status: Unreviewed
Priority: Normal
Assigned to: 
Category: unknown
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:

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")
  }
}

where config.php.erb contains:

database = <%= dbname %>

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:

class dev-webapp inherits webapp {
  $dbname = "dev-webapp"

  $filecontent = template("webapp/config.php.erb")
  File["config.php"] {
    content => $filecontent
  }
}

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

Reply via email to