diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-16 23:59:31 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-16 23:59:31 +0000 |
commit | 02cfc44af55f719235a58ca9cc23f7d29e49cd3c (patch) | |
tree | 5b364b64fd019c71201051f870976567c991be5c /lib/puppet | |
parent | 9fa779469071438f2160e45e8ab75d74e220f63b (diff) | |
download | puppet-02cfc44af55f719235a58ca9cc23f7d29e49cd3c.tar.gz puppet-02cfc44af55f719235a58ca9cc23f7d29e49cd3c.tar.xz puppet-02cfc44af55f719235a58ca9cc23f7d29e49cd3c.zip |
Simplifying the splitpath method a bit, altho it is still strangely slow
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1943 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rwxr-xr-x | lib/puppet/server/fileserver.rb | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/puppet/server/fileserver.rb b/lib/puppet/server/fileserver.rb index 53c60cdbe..2b91c8811 100755 --- a/lib/puppet/server/fileserver.rb +++ b/lib/puppet/server/fileserver.rb @@ -372,20 +372,12 @@ class Server mount = nil path = nil if dir =~ %r{/(\w+)/?} - mount = $1 - path = dir.sub(%r{/#{mount}/?}, '') + tmp = $1 + path = dir.sub(%r{/#{tmp}/?}, '') - unless @mounts.include?(mount) - raise FileServerError, "Fileserver module '%s' not mounted" % mount + unless mount = @mounts[tmp] + raise FileServerError, "Fileserver module '%s' not mounted" % tmp end - - unless @mounts[mount].valid? - raise FileServerError, - "Fileserver error: Mount '%s' does not have a path set" % mount - end - - # And now replace the name with the actual object. - mount = @mounts[mount] else raise FileServerError, "Fileserver error: Invalid path '%s'" % dir end |