From ea4b9c83810976235d3486d42e22ec8cf279abf1 Mon Sep 17 00:00:00 2001 From: luke Date: Thu, 21 Sep 2006 17:06:34 +0000 Subject: Fixing #285, opened by ericb. The problem here was that I was not escaping URIs throughout the chain, which I am now doing. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1642 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/server/fileserver.rb | 2 ++ lib/puppet/type/pfile.rb | 14 +++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'lib/puppet') diff --git a/lib/puppet/server/fileserver.rb b/lib/puppet/server/fileserver.rb index cb32212c9..85f0f5016 100755 --- a/lib/puppet/server/fileserver.rb +++ b/lib/puppet/server/fileserver.rb @@ -198,6 +198,8 @@ class Server def convert(url, client, clientip) readconfig + url = URI.unescape(url) + mount, stub = splitpath(url, client) authcheck(url, mount, client, clientip) diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb index 86b608c07..7ce384077 100644 --- a/lib/puppet/type/pfile.rb +++ b/lib/puppet/type/pfile.rb @@ -740,25 +740,21 @@ module Puppet end end - #ignore = self[:ignore] || false ignore = self[:ignore] - #self.warning "Listing path %s with ignore %s" % - # [path.inspect, ignore.inspect] desc = server.list(path, self[:links], r, ignore) - + + # Now create a new child for every file returned in the list. desc.split("\n").each { |line| file, type = line.split("\t") - next if file == "/" + next if file == "/" # skip the listing object name = file.sub(/^\//, '') - #self.warning "child name is %s" % name args = {:source => source + file} if type == file args[:recurse] = nil end + self.newchild(name, false, args) - #self.newchild(hash, source, recurse) - #hash2child(hash, source, recurse) } end @@ -862,7 +858,7 @@ module Puppet sourceobj.local = true end begin - uri = URI.parse(source) + uri = URI.parse(URI.escape(source)) rescue => detail self.fail "Could not understand source %s: %s" % [source, detail.to_s] -- cgit