diff options
author | Luke Kanies <luke@madstop.com> | 2008-06-17 10:59:52 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-06-17 10:59:52 -0500 |
commit | ce7b74c6a5094661f2af63dbdf992a12652f7778 (patch) | |
tree | 9b6dfa55a434f2e9b017ef007753bcb8d026b127 /lib/facter/Cfkey.rb | |
parent | 2ee5d29548b48a3c81f574c2be84db60f6ff306a (diff) | |
download | facter-ce7b74c6a5094661f2af63dbdf992a12652f7778.tar.gz facter-ce7b74c6a5094661f2af63dbdf992a12652f7778.tar.xz facter-ce7b74c6a5094661f2af63dbdf992a12652f7778.zip |
Rejustifying all of the whitespace in the facts, yay.
Diffstat (limited to 'lib/facter/Cfkey.rb')
-rw-r--r-- | lib/facter/Cfkey.rb | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/lib/facter/Cfkey.rb b/lib/facter/Cfkey.rb index 794971b..4c17a0a 100644 --- a/lib/facter/Cfkey.rb +++ b/lib/facter/Cfkey.rb @@ -13,31 +13,30 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston MA 02110-1301 USA ## - Facter.add(:Cfkey) do - setcode do - value = nil - ["/usr/local/etc/cfkey.pub", - "/etc/cfkey.pub", - "/var/cfng/keys/localhost.pub", - "/var/cfengine/ppkeys/localhost.pub", - "/var/lib/cfengine/ppkeys/localhost.pub", - "/var/lib/cfengine2/ppkeys/localhost.pub" - ].each { |file| - if FileTest.file?(file) - File.open(file) { |openfile| - value = openfile.readlines.reject { |line| - line =~ /PUBLIC KEY/ - }.collect { |line| - line.chomp - }.join("") - } - end - if value - break - end +Facter.add(:Cfkey) do + setcode do + value = nil + ["/usr/local/etc/cfkey.pub", + "/etc/cfkey.pub", + "/var/cfng/keys/localhost.pub", + "/var/cfengine/ppkeys/localhost.pub", + "/var/lib/cfengine/ppkeys/localhost.pub", + "/var/lib/cfengine2/ppkeys/localhost.pub" + ].each { |file| + if FileTest.file?(file) + File.open(file) { |openfile| + value = openfile.readlines.reject { |line| + line =~ /PUBLIC KEY/ + }.collect { |line| + line.chomp + }.join("") } - - value end - end + if value + break + end + } + value + end +end |