summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/type/file.rb69
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)