diff options
author | Luke Kanies <luke@madstop.com> | 2008-10-03 15:37:31 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-10-03 15:37:31 -0500 |
commit | 7a6d9b1ba93966c914f5ca9bde239ef0cdbfd15c (patch) | |
tree | 3a8d6cd295c3cbb6d1e1ab09a952bb0ecca190ce | |
parent | 1b512a9a41663d2d2983e91c7a77442049f0b505 (diff) | |
download | puppet-7a6d9b1ba93966c914f5ca9bde239ef0cdbfd15c.tar.gz puppet-7a6d9b1ba93966c914f5ca9bde239ef0cdbfd15c.tar.xz puppet-7a6d9b1ba93966c914f5ca9bde239ef0cdbfd15c.zip |
Removing obselete code from the file type.
Also shows that #674 is fixed.
Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r-- | lib/puppet/type/file.rb | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index b52759974..f2cf37e0e 100644 --- a/lib/puppet/type/file.rb +++ b/lib/puppet/type/file.rb @@ -759,75 +759,6 @@ module Puppet obj end - def localfileserver - unless defined? @@localfileserver - args = { - :Local => true, - :Mount => { "/" => "localhost" }, - :Config => false - } - @@localfileserver = Puppet::Network::Handler.handler(:fileserver).new(args) - end - @@localfileserver - end - - def uri2obj(source) - sourceobj = Puppet::Type::File::FileSource.new - path = nil - unless source - devfail "Got a nil source" - end - if source =~ /^\// - source = "file://localhost/%s" % URI.escape(source) - sourceobj.mount = "localhost" - sourceobj.local = true - end - begin - uri = URI.parse(URI.escape(source)) - rescue => detail - self.fail "Could not understand source %s: %s" % - [source, detail.to_s] - end - - case uri.scheme - when "file": - sourceobj.server = localfileserver - path = "/localhost" + uri.path - when "puppet": - # FIXME: We should cache clients by uri.host + uri.port - # not by the full source path - unless @clients.include?(source) - host = uri.host - host ||= Puppet[:server] unless Puppet[:name] == "puppet" - if host.nil? - server = localfileserver - else - args = { :Server => host } - if uri.port - args[:Port] = uri.port - end - server = Puppet::Network::Client.file.new(args) - end - @clients[source] = server - end - sourceobj.server = @clients[source] - - tmp = uri.path - if tmp =~ %r{^/(\w+)} - sourceobj.mount = $1 - path = tmp - #path = tmp.sub(%r{^/\w+},'') || "/" - else - self.fail "Invalid source path %s" % tmp - end - else - self.fail "Got other URL type '%s' from %s" % - [uri.scheme, source] - end - - return [sourceobj, path.sub(/\/\//, '/')] - end - # Write out the file. Requires the content to be written, # the property name for logging, and the checksum for validation. def write(content, property, checksum = nil) |