diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-07-21 21:25:21 -0700 |
|---|---|---|
| committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-08-19 14:46:15 -0700 |
| commit | 66fb5319b419c4145d07b4a217efc13d35e3a5a4 (patch) | |
| tree | 7e56bee81729a1b92fa84854828b16d171f5a125 /lib/puppet | |
| parent | 384302af6dec8c51442f2f29a4c7c555379cd297 (diff) | |
| download | puppet-66fb5319b419c4145d07b4a217efc13d35e3a5a4.tar.gz puppet-66fb5319b419c4145d07b4a217efc13d35e3a5a4.tar.xz puppet-66fb5319b419c4145d07b4a217efc13d35e3a5a4.zip | |
Don't use non-1.8.5-compatible methods 'Object#tap' and 'Dir.mktmpdir'
These methods aren't available until Ruby 1.8.6 (Dir.mktmpdir) and Ruby 1.8.7
(Object#tap).
Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
(cherry picked from commit 61df3f7c39d74b82e37f48c3519293406036e1e9)
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/ssl/host.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/puppet/ssl/host.rb b/lib/puppet/ssl/host.rb index 08a8ace1f..a06b1e275 100644 --- a/lib/puppet/ssl/host.rb +++ b/lib/puppet/ssl/host.rb @@ -27,10 +27,11 @@ class Puppet::SSL::Host attr_accessor :desired_state def self.localhost - @localhost ||= new.tap do |l| - l.generate unless l.certificate - l.key # Make sure it's read in - end + return @localhost if @localhost + @localhost = new + @localhost.generate unless @localhost.certificate + @localhost.key + @localhost end # This is the constant that people will use to mark that a given host is |
