Issue #4534 has been updated by Paul Berry.
Status changed from Code Insufficient to Ready for Testing
% Done changed from 0 to 100
Branch set to http://github.com/stereotype441/puppet/tree/ticket/2.6.x/4534
Extracted the code from Resource::Type#mk_plain_resource that evaluates
parents, adds the class to the catalog, and tags the catalog, and moved that
into a new method called instantiate_resource.Instantiate_resource is now also
called from Parser::Ast::Resource#evaluate, so that the notation "class {
classname: }" now executes this code too.
----------------------------------------
Bug #4534: Class inheritance with parameterized classes is ignored
http://projects.puppetlabs.com/issues/4534
Author: Thorsten Biel
Status: Ready for Testing
Priority: Normal
Assignee: Paul Berry
Category: parameterized classes
Target version: 2.6.x
Affected version:
Keywords:
Branch: http://github.com/stereotype441/puppet/tree/ticket/2.6.x/4534
I have the following classes:
<pre>
class tomcat {
import "*.pp"
create_if_no_such_file { "/etc/munin/plugin-conf.d/tomcat":
content => "[tomcat*]"
}
}
class tomcat::tomcat6 ( $java_home ) inherits tomcat {
# install Tomcat RPM
}
</pre>
and this definition:
<pre>
define setup_generic_tomcat {
# do lots of other things
file { "/etc/munin/plugins/${tc_version}_threads_${name}":
require => [ Package[munin-node],
Create_if_no_such_file[ "/etc/munin/plugin-conf.d/tomcat" ]
]
ensure => "/usr/share/munin/plugins/${tc_version}_threads_",
notify => Service[munin-node]
}
}
</pre>
which are used by this class:
<pre>
class myserver {
# include the java6 class
include java::java6
# include the tomcat module and tomcat6 class (installs Tomcat package)
class { "tomcat::tomcat6":
java_home => "${java::java6::javahome}";
}
# set up a Tomcat instance
setup_generic_tomcat { "test":
}
}
</pre>
When I try to run this, I get the following error:
<pre>
err: Could not run Puppet configuration client: Could not find dependency
Create_if_no_such_file[/etc/munin/plugin-conf.d/tomcat] for
File[/etc/munin/plugins/tomcat6_threads_test] at
/etc/puppet/modules/tomcat/manifests/setup_generic_tomcat.pp:382
</pre>
The error disappears when I remove the inheritance between
tomcat::tomcat6 and tomcat, so that instead of
<pre>
class tomcat::tomcat6 ( $java_home ) inherits tomcat {
}
</pre>
I have
<pre>
class tomcat::tomcat6 ( $java_home ) {
include tomcat
}
</pre>
To me it looks like the "tomcat" class is not properly inherited by the
parameterized "tomcat::tomcat6" class.
Inheritance in classes not using parameters works as usual.
Is this just a parsing issue, or has inheritance been forfeited when
classes use parameters?
--
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.