summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-05-16 17:17:33 -0700
committerNick Lewis <nick@puppetlabs.com>2011-05-16 17:18:17 -0700
commit809b6fe5b105cefca34149af0a03d6445f5236fc (patch)
tree0b317f9f3f5e6cb9613c3eacdeacb703ff672c1b
parent797da049bf8f90e110f27ecdd0f2aadd24392030 (diff)
downloadpuppet-809b6fe5b105cefca34149af0a03d6445f5236fc.tar.gz
puppet-809b6fe5b105cefca34149af0a03d6445f5236fc.tar.xz
puppet-809b6fe5b105cefca34149af0a03d6445f5236fc.zip
(#7297) Fix Puppet::Resource#to_manifest in Ruby 1.9
This method was relying on the implicit join in Ruby 1.8's Array#to_s, eg. [1,2,3].to_s => "123". The behavior in Ruby 1.9 is more akin to Array#inspect, eg. [1,2,3].to_s => "[1, 2, 3]". Since the array we were building was lines to be printed, the latter behavior is incorrect. So we just join into a single string, which prints consistently in all versions of Ruby. Paired-With: Josh Cooper Original patch by Aria Stewart <aredridel@nbtsc.org>
-rw-r--r--lib/puppet/resource.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb
index 214516908..59e387d00 100644
--- a/lib/puppet/resource.rb
+++ b/lib/puppet/resource.rb
@@ -269,7 +269,7 @@ class Puppet::Resource
else
" %-#{attr_max}s => %s,\n" % [ k, "\'#{v}\'" ]
end
- }
+ }.join
"%s { '%s':\n%s}" % [self.type.to_s.downcase, self.title, attributes]
end