diff options
Diffstat (limited to 'lib/puppet/parser/functions.rb')
-rw-r--r-- | lib/puppet/parser/functions.rb | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb index b02ea4308..1f9c8f519 100644 --- a/lib/puppet/parser/functions.rb +++ b/lib/puppet/parser/functions.rb @@ -113,13 +113,19 @@ module Functions ! klasses.include?(klass) end - # Throw an error if we didn't evaluate all of the classes. - if missing.length == 1 - self.fail Puppet::ParseError, - "Could not find class %s" % missing - elsif missing.length > 1 - self.fail Puppet::ParseError, - "Could not find classes %s" % missing.join(", ") + unless missing.empty? + # Throw an error if we didn't evaluate all of the classes. + str = "Could not find class" + if missing.length > 1 + str += "es" + end + + str += " " + missing.join(", ") + + if n = namespaces and ! n.empty? and n != [""] + str += " in namespaces %s" % @namespaces.join(", ") + end + self.fail Puppet::ParseError, str end end |