summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider/sshkey
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-05 01:51:23 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-05 01:51:23 +0000
commit617fe58626aa8a13af10071ca87f66d6363cf058 (patch)
treedb9974c675c3b73cae56a253386f716e83bc8b6f /lib/puppet/provider/sshkey
parent8f39318ce46148c3bd483d790c965f277a4eb1c9 (diff)
downloadpuppet-617fe58626aa8a13af10071ca87f66d6363cf058.tar.gz
puppet-617fe58626aa8a13af10071ca87f66d6363cf058.tar.xz
puppet-617fe58626aa8a13af10071ca87f66d6363cf058.zip
Removing all of the changes I made towards refactoring in the last couple of days. They have all been moved into the sync-retrieve-refactor branch. This branch will soon become 0.19.0, and will not include that refactoring.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1555 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/provider/sshkey')
-rwxr-xr-xlib/puppet/provider/sshkey/parsed.rb56
1 files changed, 0 insertions, 56 deletions
diff --git a/lib/puppet/provider/sshkey/parsed.rb b/lib/puppet/provider/sshkey/parsed.rb
deleted file mode 100755
index e1dbeaad6..000000000
--- a/lib/puppet/provider/sshkey/parsed.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'puppet/provider/parsedfile'
-
-Puppet::Type.type(:sshkey).provide :parsed, :parent => Puppet::Provider::ParsedFile do
- @filetype = Puppet::FileType.filetype(:flat)
- @path = "/etc/ssh/ssh_known_hosts"
- @fields = [:name, :type, :key]
-
- # Parse an sshknownhosts file
- #
- # This method also stores existing comments, and it stores all host
- # jobs in order, mostly so that comments are retained in the order
- # they were written and in proximity to the same jobs.
- def self.parse(text)
- count = 0
- instances = []
- text.chomp.split("\n").each { |line|
- hash = {}
- case line
- when /^#/, /^\s*$/:
- # add comments and blank lines to the list as they are
- instances << line
- else
- hash = {}
- fields().zip(line.split(" ")).each { |param, value|
- hash[param] = value
- }
-
- if hash[:name] =~ /,/
- names = hash[:name].split(",")
- hash[:name] = names.shift
- hash[:alias] = names
- end
-
- if hash[:alias] == ""
- hash.delete(:alias)
- end
-
- instances << hash
- count += 1
- end
- }
-
- return instances
- end
-
- # Convert the current object into an entry for a known-hosts file.
- def self.to_record(hash)
- name = hash[:name]
- if hash.include?(:alias)
- name += "," + hash[:alias].join(",")
- end
- [name, hash[:type], hash[:key]].join(" ")
- end
-end
-
-# $Id$