From 5aa596c99cac2e578860dc236ec99b908840518d Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Tue, 9 Feb 2010 22:25:38 +0100 Subject: Fix #3150 - require function doesn't like ::class syntax Signed-off-by: Brice Figureau --- lib/puppet/parser/functions/require.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/puppet/parser') 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, -- cgit