summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-03-31 16:46:43 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-04-04 10:19:53 -0700
commit3d88808270e9a0cb848a66825c66676598559dc3 (patch)
tree617dcec0462f7c56537c84bcb9e50ded0357901a /lib
parentc52261c7aa86e7e75f215ba0f6b8c140003c4ead (diff)
downloadpuppet-3d88808270e9a0cb848a66825c66676598559dc3.tar.gz
puppet-3d88808270e9a0cb848a66825c66676598559dc3.tar.xz
puppet-3d88808270e9a0cb848a66825c66676598559dc3.zip
(#6749) base indirector string should fail on invalid terminus.
We used to generate an info-level message, then carry on, which typically resulted in raising because 'nil' doesn't implement the expected method that we immediately try to call. So, instead, raise a clear error at the time we fail to load, which gives a pleasant rather than confusing error to the user. Which at least means they know why things have gone wrong... Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/string/indirector.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/puppet/string/indirector.rb b/lib/puppet/string/indirector.rb
index 71b1f3b12..0f5f405ff 100644
--- a/lib/puppet/string/indirector.rb
+++ b/lib/puppet/string/indirector.rb
@@ -59,7 +59,8 @@ that we should describe in this file somehow."
# One usually does.
def indirection
unless @indirection
- Puppet.info("Could not find terminus for #{indirection_name}") unless @indirection = Puppet::Indirector::Indirection.instance(indirection_name)
+ @indirection = Puppet::Indirector::Indirection.instance(indirection_name)
+ @indirection or raise "Could not find terminus for #{indirection_name}"
end
@indirection
end