diff options
author | Luke Kanies <luke@madstop.com> | 2008-08-24 14:11:48 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-08-26 22:40:40 -0700 |
commit | 550e3d6ad5aadfe99fc1e10efa77cc193d3a9df3 (patch) | |
tree | 5945db48003ab63c68db4f5d229345fb3ecef1a9 /lib/puppet/indirector/module_files.rb | |
parent | 90e70227b0bb7cfd104ae34de8f7c2b7250edb09 (diff) | |
download | puppet-550e3d6ad5aadfe99fc1e10efa77cc193d3a9df3.tar.gz puppet-550e3d6ad5aadfe99fc1e10efa77cc193d3a9df3.tar.xz puppet-550e3d6ad5aadfe99fc1e10efa77cc193d3a9df3.zip |
Finishing the rename of FileBase => Base.
Git did something really strange, in that it apparently didn't
add the new base.rb files even though I used 'git mv'.
Also fixing some other failing tests I hadn't previously tracked
down because of the magical tuple of autotest's suckiness and
my laziness.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/indirector/module_files.rb')
-rw-r--r-- | lib/puppet/indirector/module_files.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/puppet/indirector/module_files.rb b/lib/puppet/indirector/module_files.rb index cf5c29cab..40dd06941 100644 --- a/lib/puppet/indirector/module_files.rb +++ b/lib/puppet/indirector/module_files.rb @@ -21,7 +21,7 @@ class Puppet::Indirector::ModuleFiles < Puppet::Indirector::Terminus # Make sure our file path starts with /modules, so that we authorize # against the 'modules' mount. - path = uri.path =~ /^\/modules/ ? uri.path : "/modules" + uri.path + path = uri.path =~ /^modules\// ? uri.path : "modules/" + uri.path configuration.authorized?(path, :node => request.node, :ipaddress => request.ip) end @@ -66,9 +66,8 @@ class Puppet::Indirector::ModuleFiles < Puppet::Indirector::Terminus def find_path(request) uri = key2uri(request.key) - # Strip off /modules if it's there -- that's how requests get routed to this terminus. - # Also, strip off the leading slash if present. - module_name, relative_path = uri.path.sub(/^\/modules\b/, '').sub(%r{^/}, '').split(File::Separator, 2) + # Strip off modules/ if it's there -- that's how requests get routed to this terminus. + module_name, relative_path = uri.path.sub(/^modules\//, '').sub(%r{^/}, '').split(File::Separator, 2) # And use the environment to look up the module. return nil unless mod = find_module(module_name, request.node) |