diff options
author | Luke Kanies <luke@madstop.com> | 2008-08-23 18:36:03 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-08-26 22:40:39 -0700 |
commit | bcd40fb58338e44d46452c47c0ef150a96a5f829 (patch) | |
tree | abc5f83421ff7c9963d315ec1d99e01ab70d7c05 | |
parent | 0a05720e6c4bd0875fc03b53263ff26c6fe14de2 (diff) | |
download | puppet-bcd40fb58338e44d46452c47c0ef150a96a5f829.tar.gz puppet-bcd40fb58338e44d46452c47c0ef150a96a5f829.tar.xz puppet-bcd40fb58338e44d46452c47c0ef150a96a5f829.zip |
Cleaning up an exception.
Only adding option information when options are present.
Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r-- | lib/puppet/indirector/indirection.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/indirector/indirection.rb b/lib/puppet/indirector/indirection.rb index a9fff75b8..e6068a6aa 100644 --- a/lib/puppet/indirector/indirection.rb +++ b/lib/puppet/indirector/indirection.rb @@ -262,7 +262,11 @@ class Puppet::Indirector::Indirection return unless terminus.respond_to?(:authorized?) unless terminus.authorized?(request) - raise ArgumentError, "Not authorized to call %s on %s with %s" % [request.method, request.key, request.options.inspect] + msg = "Not authorized to call %s on %s" % [request.method, request.key] + unless request.options.empty? + msg += " with %s" % request.options.inspect + end + raise ArgumentError, msg end end |