diff options
Diffstat (limited to 'lib/puppet/network/handler/fileserver.rb')
-rwxr-xr-x | lib/puppet/network/handler/fileserver.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index 50e2614aa..6bc6d9d4a 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -53,7 +53,7 @@ class Puppet::Network::Handler mount = Mount.new(MODULES) mount.allow("*") @mounts[MODULES] = mount - + Puppet.debug "No file server configuration file; autocreating #{PLUGINS} mount with default permissions" mount = PluginMount.new(PLUGINS) mount.allow("*") @@ -145,7 +145,7 @@ class Puppet::Network::Handler desc.collect { |sub| sub.join("\t") }.join("\n") end - + def local? self.local end @@ -349,14 +349,14 @@ class Puppet::Network::Handler mount.allow("*") newmounts[MODULES] = mount end - + unless newmounts[PLUGINS] Puppet.debug "No #{PLUGINS} mount given; autocreating with default permissions" mount = PluginMount.new(PLUGINS) mount.allow("*") newmounts[PLUGINS] = mount end - + unless newmounts[PLUGINS].valid? Puppet.debug "No path given for #{PLUGINS} mount; creating a special PluginMount" # We end up here if the user has specified access rules for @@ -372,7 +372,7 @@ class Puppet::Network::Handler ) newmounts[PLUGINS] = mount end - + # Verify each of the mounts are valid. # We let the check raise an error, so that it can raise an error # pointing to the specific problem. @@ -433,7 +433,7 @@ class Puppet::Network::Handler # Create a map for a specific client. def clientmap(client) { - "h" => client.sub(/\..*$/, ""), + "h" => client.sub(/\..*$/, ""), "H" => client, "d" => client.sub(/[^.]+\./, "") # domain name } @@ -454,7 +454,7 @@ class Puppet::Network::Handler end path.gsub(/%(.)/) do |v| key = $1 - if key == "%" + if key == "%" "%" else map[key] || v @@ -698,7 +698,7 @@ class Puppet::Network::Handler # A special mount class specifically for the plugins mount -- just # has some magic to effectively do a union mount of the 'plugins' # directory of all modules. - # + # class PluginMount < Mount def path(client) '' @@ -719,7 +719,7 @@ class Puppet::Network::Handler def mod_file_path(mod, relpath, client = nil) File.join(mod, PLUGINS, relpath) end - + def file_path(relpath, client = nil) return nil unless mod = valid_modules(client).find { |m| m.plugin(relpath) } mod.plugin(relpath) @@ -746,7 +746,7 @@ class Puppet::Network::Handler def valid_modules(client) Puppet::Node::Environment.new.modules.find_all { |mod| mod.exist? } end - + def add_to_filetree(f, filetree) first, rest = f.split(File::SEPARATOR, 2) end |