diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2011-07-29 12:29:51 -0700 |
|---|---|---|
| committer | Matt Robinson <matt@puppetlabs.com> | 2011-07-29 12:52:02 -0700 |
| commit | 94f0b93b6065d1818f0f3b99d12d651655247c30 (patch) | |
| tree | 3cab88d68ec7f2f4ac0347cec997d172ef04cc33 /lib | |
| parent | 5682125e1800f4c7b69b20fdd28f97a473d5d93c (diff) | |
| download | puppet-94f0b93b6065d1818f0f3b99d12d651655247c30.tar.gz puppet-94f0b93b6065d1818f0f3b99d12d651655247c30.tar.xz puppet-94f0b93b6065d1818f0f3b99d12d651655247c30.zip | |
(#8704) Give better errors for invalid fileserver.conf
If you tried to just put an allow or deny line in the fileserver.conf
without a mount point, you got a really confusing error message:
lib/puppet/network/handler/fileserver.rb:285:in `readconfig': undefined method `info' for nil:NilClass (NoMethodError)
Now instead we give an error saying no mount point was specified.
Reviewed-by: Josh Cooper <josh@puppetlabs.com>
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/puppet/network/handler/fileserver.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index 5b4b17a32..5da4cedef 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -269,6 +269,7 @@ class Puppet::Network::Handler value = $2 case var when "path" + raise FileServerError.new("No mount specified for argument #{var} #{value}") unless mount if mount.name == MODULES Puppet.warning "The '#{mount.name}' module can not have a path. Ignoring attempt to set it" else @@ -280,6 +281,7 @@ class Puppet::Network::Handler end end when "allow" + raise FileServerError.new("No mount specified for argument #{var} #{value}") unless mount value.split(/\s*,\s*/).each { |val| begin mount.info "allowing #{val} access" @@ -294,6 +296,7 @@ class Puppet::Network::Handler end } when "deny" + raise FileServerError.new("No mount specified for argument #{var} #{value}") unless mount value.split(/\s*,\s*/).each { |val| begin mount.info "denying #{val} access" |
