diff options
author | mh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279> | 2008-07-25 11:17:06 +0000 |
---|---|---|
committer | mh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279> | 2008-07-25 11:17:06 +0000 |
commit | 34bcb5c3d607d580a19ccba06fe43b6d02a8eb00 (patch) | |
tree | d5d6a4cbf96ec4d41a1a566c5c8b509669b74ab8 /plugins/facter/sshkeys.rb | |
parent | e50ea57b58f19391e83d85c734530678d0519e58 (diff) | |
download | puppet-sshd-34bcb5c3d607d580a19ccba06fe43b6d02a8eb00.tar.gz puppet-sshd-34bcb5c3d607d580a19ccba06fe43b6d02a8eb00.tar.bz2 |
fixed fact as centos doesn't seem to add the hostname to the hostkey, fixed package requirement
git-svn-id: https://svn/ipuppet/trunk/modules/sshd@1994 d66ca3ae-40d7-4aa7-90d4-87d79ca94279
Diffstat (limited to 'plugins/facter/sshkeys.rb')
-rw-r--r-- | plugins/facter/sshkeys.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/facter/sshkeys.rb b/plugins/facter/sshkeys.rb index abf838c..0e94a03 100644 --- a/plugins/facter/sshkeys.rb +++ b/plugins/facter/sshkeys.rb @@ -6,10 +6,11 @@ value = nil filepath = File.join(dir,file) if FileTest.file?(filepath) - regex = %r{^(\S+) (\S+) (\S+)$} + regex1 = %r{^(\S+) (\S+) (\S+)$} + regex2 = %r{^(\S+) (\S+)(\s+)$} begin line = File.open(filepath).read.chomp - if match = regex.match(line) + if (match = regex1.match(line)) or (match = regex2.match(line)) value = match[2] end rescue |