summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorJosh Cooper <josh@puppetlabs.com>2011-08-19 14:51:19 -0700
committerJosh Cooper <josh@puppetlabs.com>2011-08-19 14:51:19 -0700
commit299932691c7a67c93275e978c52132ff99cae4f5 (patch)
tree7e56bee81729a1b92fa84854828b16d171f5a125 /lib/puppet
parent384302af6dec8c51442f2f29a4c7c555379cd297 (diff)
parent66fb5319b419c4145d07b4a217efc13d35e3a5a4 (diff)
downloadpuppet-299932691c7a67c93275e978c52132ff99cae4f5.tar.gz
puppet-299932691c7a67c93275e978c52132ff99cae4f5.tar.xz
puppet-299932691c7a67c93275e978c52132ff99cae4f5.zip
Merge remote-tracking branch 'jhelwig/add-missing-commit-for-ruby-1.8.5-compatibility-to-2.7.x' into 2.7.x
* jhelwig/add-missing-commit-for-ruby-1.8.5-compatibility-to-2.7.x: Don't use non-1.8.5-compatible methods 'Object#tap' and 'Dir.mktmpdir'
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