Issue #2021 has been updated by jamtur01. Status changed from Ready for Checkin to Closed
Fixed in commit:"7a819454febdf34f4384e1bc64c5b2599df4bd38" in branch master. ---------------------------------------- Bug #2021: Returning boolean not always possible http://projects.reductivelabs.com/issues/2021 Author: immerda Status: Ready for Checkin Priority: Normal Assigned to: jamtur01 Category: binary Target version: 1.6.0 Complexity: Unknown Keywords: boolean, return assume the following code: <pre> #cat facter/selinux.rb Facter.add("selinux") do confine :kernel => :linux setcode do result = false if FileTest.exists?("/selinux/enforce") result = true end result end end </pre> one time it is working, the other time not: <pre> # export RUBYLIB=`pwd` # facter selinux false # facter /usr/lib/ruby/site_ruby/1.8/facter/util/confine.rb:37:in `true?': undefined method `downcase' for false:FalseClass (NoMethodError) from /usr/lib/ruby/site_ruby/1.8/facter/util/confine.rb:36:in `each' from /usr/lib/ruby/site_ruby/1.8/facter/util/confine.rb:36:in `true?' from /usr/lib/ruby/site_ruby/1.8/facter/util/resolution.rb:101:in `suitable?' from /usr/lib/ruby/site_ruby/1.8/facter/util/ip.rb:145:in `detect' from /usr/lib/ruby/site_ruby/1.8/facter/util/resolution.rb:101:in `each' from /usr/lib/ruby/site_ruby/1.8/facter/util/resolution.rb:101:in `detect' from /usr/lib/ruby/site_ruby/1.8/facter/util/resolution.rb:101:in `suitable?' from /usr/lib/ruby/site_ruby/1.8/facter/util/fact.rb:72:in `value' ... 10 levels... from /usr/lib/ruby/site_ruby/1.8/facter/util/collection.rb:103:in `to_hash' from /usr/lib/ruby/site_ruby/1.8/facter.rb:92:in `send' from /usr/lib/ruby/site_ruby/1.8/facter.rb:92:in `to_hash' from /usr/bin/facter:125 </pre> if I debug it I can see that value/values is one time a string and the other time a FalseClass or TrueClass Please note that returning a string isn't possible due to a bug in puppet I'll report shortly. This worked on 1.3.8. -- 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 -~----------~----~----~----~------~----~------~--~---
