diff options
author | Luke Kanies <luke@madstop.com> | 2008-04-19 15:30:11 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-04-19 15:30:11 -0500 |
commit | 934fbba81cb18f05e07675d79a2e830c4e95c918 (patch) | |
tree | 271bc1b8f94904e24be6b4823b304ef8787f4e9e /lib/puppet | |
parent | d4813f1e03d96551e91b104e48b028fb4074d398 (diff) | |
download | puppet-934fbba81cb18f05e07675d79a2e830c4e95c918.tar.gz puppet-934fbba81cb18f05e07675d79a2e830c4e95c918.tar.xz puppet-934fbba81cb18f05e07675d79a2e830c4e95c918.zip |
Making the SSL::Host's destroy method a class method,
rather than an instance method.
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/ssl/host.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/puppet/ssl/host.rb b/lib/puppet/ssl/host.rb index c1dac2050..931d64ab3 100644 --- a/lib/puppet/ssl/host.rb +++ b/lib/puppet/ssl/host.rb @@ -74,6 +74,16 @@ class Puppet::SSL::Host end end + # Remove all traces of a given host + def self.destroy(name) + [Key, Certificate, CertificateRequest].inject(false) do |result, klass| + if klass.destroy(name) + result = true + end + result + end + end + # Search for more than one host, optionally only specifying # an interest in hosts with a given file type. # This just allows our non-indirected class to have one of @@ -131,13 +141,6 @@ class Puppet::SSL::Host @certificate end - # Remove all traces of this ssl host - def destroy - [key, certificate, certificate_request].each do |instance| - instance.class.destroy(name) if instance - end - end - def initialize(name) @name = name @key = @certificate = @certificate_request = nil |