summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-07-21 21:25:21 -0700
committerNick Lewis <nick@puppetlabs.com>2011-07-21 21:27:42 -0700
commit61df3f7c39d74b82e37f48c3519293406036e1e9 (patch)
tree26fc31552c7eb50173067b5957e5a8ba2c41465d /lib/puppet
parentc5d70ed11f8f964523ca049d6c3d504de3840c1a (diff)
downloadpuppet-61df3f7c39d74b82e37f48c3519293406036e1e9.tar.gz
puppet-61df3f7c39d74b82e37f48c3519293406036e1e9.tar.xz
puppet-61df3f7c39d74b82e37f48c3519293406036e1e9.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>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/ssl/host.rb9
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