summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-02 06:58:42 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-02 06:58:42 +0000
commitcc05e8d97d233e698a5d70e7d5a288a78a942389 (patch)
tree50f949bbcb7bc53e340bfcfb096a846436bc5066
parent57d093309f7fcc003cbd420133a8923e1174260c (diff)
downloadpuppet-cc05e8d97d233e698a5d70e7d5a288a78a942389.tar.gz
puppet-cc05e8d97d233e698a5d70e7d5a288a78a942389.tar.xz
puppet-cc05e8d97d233e698a5d70e7d5a288a78a942389.zip
Fixing the error thrown when a dependency cannot be retrieved, WRT to #395.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2015 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--lib/puppet/metatype/metaparams.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/puppet/metatype/metaparams.rb b/lib/puppet/metatype/metaparams.rb
index 93fffc04c..1d58d27f2 100644
--- a/lib/puppet/metatype/metaparams.rb
+++ b/lib/puppet/metatype/metaparams.rb
@@ -266,14 +266,16 @@ class Puppet::Type
tname, name = value
object = nil
if type = Puppet::Type.type(tname)
- unless object = type[name]
- self.fail "Could not retrieve object '%s' of type '%s'" %
- [name,type]
- end
+ object = type[name]
else # try to treat it as a component
- unless object = Puppet::Type::Component["#{tname}[#{name}]"]
- self.fail "Could not find object %s[%s]" % [tname, name]
- end
+ object = Puppet::Type::Component["#{tname}[#{name}]"]
+ end
+
+ # Either of the two retrieval attempts could have returned
+ # nil.
+ unless object
+ self.fail "Could not retrieve dependency '%s[%s]'" %
+ [type.capitalize, name]
end
self.debug("subscribes to %s" % [object])