diff options
-rw-r--r-- | lib/puppet/client/master.rb | 2 | ||||
-rw-r--r-- | test/client/master.rb | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/puppet/client/master.rb b/lib/puppet/client/master.rb index 3f29eb44e..53d58daa1 100644 --- a/lib/puppet/client/master.rb +++ b/lib/puppet/client/master.rb @@ -34,7 +34,7 @@ class Puppet::Client::MasterClient < Puppet::Client def self.facts facts = {} Facter.each { |name,fact| - facts[name] = fact.downcase + facts[name] = fact.to_s.downcase } # Add our client version to the list of facts, so people can use it diff --git a/test/client/master.rb b/test/client/master.rb index d5af1b82d..06590721f 100644 --- a/test/client/master.rb +++ b/test/client/master.rb @@ -115,4 +115,22 @@ class TestMasterClient < Test::Unit::TestCase end assert(! client.locked?) end + + # Make sure non-string facts don't make things go kablooie + def test_nonstring_facts + # Add a nonstring fact + Facter.add(:nonstring) do + setcode { 1 } + end + + assert_equal(1, Facter.nonstring, "Fact was a string from facter") + + client = mkclient() + + assert(! FileTest.exists?(@createdfile)) + + assert_nothing_raised { + client.run + } + end end |