summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/functions
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2010-02-09 22:25:38 +0100
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitc694c4d34fea8b45695222321930e64b8991887a (patch)
tree08640321e2e770b69fa44fb711fd206827103fe9 /lib/puppet/parser/functions
parent075f3c8df516bd52d412dc8d88fe194cf4edfb5b (diff)
downloadpuppet-c694c4d34fea8b45695222321930e64b8991887a.tar.gz
puppet-c694c4d34fea8b45695222321930e64b8991887a.tar.xz
puppet-c694c4d34fea8b45695222321930e64b8991887a.zip
Fix #3150 - require function doesn't like ::class syntax
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r--lib/puppet/parser/functions/require.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/require.rb b/lib/puppet/parser/functions/require.rb
index d72169af5..3e7961933 100644
--- a/lib/puppet/parser/functions/require.rb
+++ b/lib/puppet/parser/functions/require.rb
@@ -37,6 +37,13 @@ fail if used with earlier clients.
vals = [vals] unless vals.is_a?(Array)
vals.each do |klass|
+ # lookup the class in the scopes
+ if classobj = find_hostclass(klass)
+ klass = classobj.classname
+ else
+ raise Puppet::ParseError, "Could not find class %s" % klass
+ end
+
# This is a bit hackish, in some ways, but it's the only way
# to configure a dependency that will make it to the client.
# The 'obvious' way is just to add an edge in the catalog,