Lorenz Schori
2011-Jun-10 08:00 UTC
[Puppet Users] Upgrade from 0.24.5 to 2.6.2: Could not find resource(s) M[test] for overriding
Hi,
I''ve been upgrading from Debian Lenny to Squeeze and now many of my
puppet modules are failing with the message "Could not find
resource(s) X for overriding on node Y". I''ve isolated the problem
case
and apparently properties of defined resources may not be overridden
anymore in recent versions.
Consider the following two test cases:
A: inherit-built-in-resource.pp:
class p {
notify{"test":
message => "hello",
}
}
class c inherits p {
Notify["test"] {
message => "overridden",
}
}
include c
B: inherit-defined-resource.pp
class p {
define m($message) {
notify{"${message}":}
}
m{"test":
message => "hello",
}
}
class c inherits p {
M["test"] {
message => "overridden",
}
}
include c
When running those two test cases with different versions of puppet I
get the following:
Debian Lenny / Puppet 0.24.5
# puppet -V
dnsdomainname: puppet-lenny
0.24.5
# puppet inherit-built-in-resource.pp
dnsdomainname: puppet-lenny
notice: overridden
# puppet inherit-defined-resource.pp
dnsdomainname: puppet-lenny
notice: overridden
Debian Squeeze / Puppet 2.6.2
# puppet -V
2.6.2
# puppet inherit-built-in-resource.pp
sh: Syntax error: Bad fd number
notice: overridden
notice: /Stage[main]/P/Notify[test]/message: defined
''message'' as
''overridden''
# puppet inherit-defined-resource.pp
sh: Syntax error: Bad fd number
Could not find resource(s) M[test] for overriding on node
puppet-squeeze
Can anybody give me a hint on how to fix that manifest for puppet 2.6?
Thanks
Lorenz
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Lorenz Schori
2011-Jun-10 08:38 UTC
Re: [Puppet Users] Upgrade from 0.24.5 to 2.6.2: Could not find resource(s) M[test] for overriding
Hi again, Am Fri, 10 Jun 2011 10:00:28 +0200 schrieb Lorenz Schori <lorenz.schori@gmail.com>:> Debian Squeeze / Puppet 2.6.2 > [...] > Could not find resource(s) M[test] for overriding on node > puppet-squeezeI''ve now verified that this problem was not present in the latest legacy version 0.25.5 (installed manually) but is still present in the latest stable version 2.6.8 as well as in 2.7.0rc4 (also installed manually). I did reread the release notes of 2.6.0 but was not able to find a reference to changed behaviour of defined resources. Also I can exclude that the problem was introduced by debian maintainers because it also occures with a clean install from original sources. Ideas? Lorenz -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Brice Figureau
2011-Jun-10 10:08 UTC
Re: [Puppet Users] Upgrade from 0.24.5 to 2.6.2: Could not find resource(s) M[test] for overriding
On Fri, 2011-06-10 at 10:00 +0200, Lorenz Schori wrote:> Hi, > > I''ve been upgrading from Debian Lenny to Squeeze and now many of my > puppet modules are failing with the message "Could not find > resource(s) X for overriding on node Y". I''ve isolated the problem case > and apparently properties of defined resources may not be overridden > anymore in recent versions. > > Consider the following two test cases: > > [snip]> B: inherit-defined-resource.pp > class p { > define m($message) { > notify{"${message}":} > } > > m{"test": > message => "hello", > } > } > > class c inherits p { > M["test"] { > message => "overridden", > } > }I think puppet is looking M in the scope of C, but not in the scope of P anymore. Can you rewrite it like this and test: class c inherits p { P::M["test"] { message => "overridden", } } I''m confident this will solve your issue, but I don''t remember exactly if this behavior changed in 2.6.x. In any case, you should open a redmine ticket with your observations. -- Brice Figureau Follow the latest Puppet Community evolutions on www.planetpuppet.org! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Lorenz Schori
2011-Jun-10 13:21 UTC
Re: [Puppet Users] Upgrade from 0.24.5 to 2.6.2: Could not find resource(s) M[test] for overriding
Am Fri, 10 Jun 2011 12:08:28 +0200 schrieb Brice Figureau <brice-puppet@daysofwonder.com>:> [...] > I think puppet is looking M in the scope of C, but not in the scope > of P anymore. > Can you rewrite it like this and test: > > class c inherits p { > P::M["test"] { > message => "overridden", > } > } > > I''m confident this will solve your issue, but I don''t remember exactly > if this behavior changed in 2.6.x.Thanks! That did the trick. Actually this version also works on 0.25.x. Cheers Lorenz -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.