diff options
author | Luke Kanies <luke@madstop.com> | 2008-08-23 18:25:18 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-08-26 22:40:39 -0700 |
commit | 0a05720e6c4bd0875fc03b53263ff26c6fe14de2 (patch) | |
tree | 9d51813a23f8a3a9d16b976bd67fc64b0adb7c2c /lib/puppet | |
parent | 237b7b294bf90c87891964d01429bbdd42a92524 (diff) | |
download | puppet-0a05720e6c4bd0875fc03b53263ff26c6fe14de2.tar.gz puppet-0a05720e6c4bd0875fc03b53263ff26c6fe14de2.tar.xz puppet-0a05720e6c4bd0875fc03b53263ff26c6fe14de2.zip |
FileServing Configurations now expect unqualified files.
This fits in with the fact that the indirection requests split URIs
and set the request key to an unqualified path rather than
a fully-qualified path.
The whole system is unqualified end-to-end, now, except when you're
specifically asking for a full, local file name.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/file_serving/configuration.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/puppet/file_serving/configuration.rb b/lib/puppet/file_serving/configuration.rb index 9c38aaa19..bceecc30c 100644 --- a/lib/puppet/file_serving/configuration.rb +++ b/lib/puppet/file_serving/configuration.rb @@ -98,13 +98,14 @@ class Puppet::FileServing::Configuration # Reparse the configuration if necessary. readconfig - raise(ArgumentError, "Cannot find file: Invalid path '%s'" % uri) unless uri =~ %r{/([-\w]+)/?} + raise(ArgumentError, "Cannot find file: Invalid path '%s'" % uri) unless uri =~ %r{^([-\w]+)(/|$)} # the dir is based on one of the mounts # so first retrieve the mount path mount = path = nil + # Strip off the mount name. - mount_name, path = uri.sub(%r{^/}, '').split(File::Separator, 2) + mount_name, path = uri.split(File::Separator, 2) return nil unless mount = @mounts[mount_name] |