(#22362) Changes in const_defined?() on ruby 1.9 break Puppet::Util::Cla...#1864
Conversation
|
The example may be actually simplified: |
|
Waiting for CLA signature by @ptomulik @ptomulik - We require a Contributor License Agreement (CLA) for people who contribute to Puppet, but we have an easy click-through license with instructions, which is available at https://cla.puppetlabs.com/ Note: if your contribution is trivial and you think it may be exempt from the CLA, please post a short reply to this comment with details. http://docs.puppetlabs.com/community/trivial_patch_exemption.html |
|
Signed CLA. Also: the contribution is trivial |
|
CLA signed by all contributors. |
|
Cross-reference: This is Redmine #22362 |
|
Thank you very much for this contribution! For clarification, the type declaration: module Puppet
newtype() do
# etc
end
endis a less common way of invoking Puppet::Type.newtype(:packagex) do
# etc
endAnd see if this has any impact on the issue raised? |
|
No, this has no influence. The exception is still raised. It disappears once the patch is applied. |
|
Fair enough, and your change is a good one. (That being said, you might want to prefer the latter type declaration). It doesn't look like there are any existing unit tests for Classgen, so I think this is ready for merging. |
(#22362) Changes in const_defined?() on ruby 1.9 break Puppet::Util::Cla...
|
summary: merged into master in 7f4b593; this should be released in 3.4.0. Thanks for the contribution! |
I have this example (three files):
and
and
Running 'ruby test.rb' fails on ruby >=1.9 with the following exception:
The problem appears, when using
newtypewith:parentargument. I've tracked down the problem and found that the exception is raised fromPuppet::Util::Classgen.rmclass(). The method usesconst_defined?()whose behavior changed in ruby 1.9.