diff options
-rw-r--r-- | lib/puppet/file_serving/configuration.rb | 2 | ||||
-rwxr-xr-x | spec/unit/file_serving/configuration.rb | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/puppet/file_serving/configuration.rb b/lib/puppet/file_serving/configuration.rb index 6f36d2750..3140455c7 100644 --- a/lib/puppet/file_serving/configuration.rb +++ b/lib/puppet/file_serving/configuration.rb @@ -96,7 +96,9 @@ class Puppet::FileServing::Configuration def mk_default_mounts @mounts["modules"] ||= Mount::Modules.new("modules") + @mounts["modules"].allow('*') @mounts["plugins"] ||= Mount::Plugins.new("plugins") + @mounts["plugins"].allow('*') end # Read the configuration file. diff --git a/spec/unit/file_serving/configuration.rb b/spec/unit/file_serving/configuration.rb index 9545f01cc..57ae83a14 100755 --- a/spec/unit/file_serving/configuration.rb +++ b/spec/unit/file_serving/configuration.rb @@ -102,6 +102,19 @@ describe Puppet::FileServing::Configuration do config.mounted?("plugins").should be_true end + it "should allow all access to modules and plugins if no fileserver.conf exists" do + FileTest.expects(:exists?).returns false # the file doesn't exist + modules = stub 'modules' + Puppet::FileServing::Mount::Modules.stubs(:new).returns(modules) + modules.expects(:allow).with('*') + + plugins = stub 'plugins' + Puppet::FileServing::Mount::Plugins.stubs(:new).returns(plugins) + plugins.expects(:allow).with('*') + + Puppet::FileServing::Configuration.create + end + it "should add modules and plugins mounts even if they are not returned by the parser" do @parser.expects(:parse).returns("one" => mock("mount")) FileTest.expects(:exists?).returns true # the file doesn't exist |