diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-04-30 15:57:57 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-04-30 15:57:57 +0000 |
| commit | 7e971436c9967c5bfe95a418911db41f4e937696 (patch) | |
| tree | d07e957f4f33672242cfe272b42ead5b4a055bcc | |
| parent | 4dbcc5d2dafde3e4388937ab9b81174e2758bbe7 (diff) | |
| download | puppet-7e971436c9967c5bfe95a418911db41f4e937696.tar.gz puppet-7e971436c9967c5bfe95a418911db41f4e937696.tar.xz puppet-7e971436c9967c5bfe95a418911db41f4e937696.zip | |
Allowing "-" in fileserver module names, #617
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2434 980ebf18-57e1-0310-9a29-db15c13687c0
| -rwxr-xr-x | lib/puppet/network/handler/fileserver.rb | 6 | ||||
| -rwxr-xr-x | test/network/handler/fileserver.rb | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index 1dd6ad793..0170eae7b 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -253,7 +253,7 @@ class Puppet::Network::Handler case line when /^\s*#/: next # skip comments when /^\s*$/: next # skip blank lines - when /\[(\w+)\]/: + when /\[([-\w]+)\]/: name = $1 if newmounts.include?(name) raise FileServerError, "%s is already mounted at %s" % @@ -384,7 +384,7 @@ class Puppet::Network::Handler # so first retrieve the mount path mount = nil path = nil - if dir =~ %r{/(\w+)/?} + if dir =~ %r{/([-\w]+)/?} tmp = $1 path = dir.sub(%r{/#{tmp}/?}, '') @@ -490,7 +490,7 @@ class Puppet::Network::Handler # Create out object. It must have a name. def initialize(name, path = nil) - unless name =~ %r{^\w+$} + unless name =~ %r{^[-\w]+$} raise FileServerError, "Invalid name format '%s'" % name end @name = name diff --git a/test/network/handler/fileserver.rb b/test/network/handler/fileserver.rb index c4db60f71..4c5af8a9a 100755 --- a/test/network/handler/fileserver.rb +++ b/test/network/handler/fileserver.rb @@ -232,7 +232,7 @@ class TestFileServer < Test::Unit::TestCase # verify we can mount /, which is what local file servers will # normally do - def test_zmountroot + def test_mountroot server = nil assert_nothing_raised { server = Puppet::Network::Handler.fileserver.new( @@ -456,7 +456,7 @@ class TestFileServer < Test::Unit::TestCase # make some dirs for mounting Dir.mkdir(basedir) mounts = {} - %w{thing thus these those}.each { |dir| + %w{thing thus the-se those}.each { |dir| path = File.join(basedir, dir) Dir.mkdir(path) mounts[dir] = mktestfiles(path) @@ -479,8 +479,8 @@ class TestFileServer < Test::Unit::TestCase allow *.madstop.com, *.kanies.com deny *.sub.madstop.com -[these] - path #{basedir}/these +[the-se] + path #{basedir}/the-se [those] path #{basedir}/those |
