diff options
author | Nick Lewis <nick@puppetlabs.com> | 2011-05-16 17:17:33 -0700 |
---|---|---|
committer | Nick Lewis <nick@puppetlabs.com> | 2011-05-16 17:18:17 -0700 |
commit | 809b6fe5b105cefca34149af0a03d6445f5236fc (patch) | |
tree | 0b317f9f3f5e6cb9613c3eacdeacb703ff672c1b | |
parent | 797da049bf8f90e110f27ecdd0f2aadd24392030 (diff) | |
download | puppet-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.rb | 2 |
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 |