summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/hostclass.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/ast/hostclass.rb')
-rw-r--r--lib/puppet/parser/ast/hostclass.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/puppet/parser/ast/hostclass.rb b/lib/puppet/parser/ast/hostclass.rb
index 251d5eba6..4f2d00f0c 100644
--- a/lib/puppet/parser/ast/hostclass.rb
+++ b/lib/puppet/parser/ast/hostclass.rb
@@ -18,6 +18,15 @@ class Puppet::Parser::AST::HostClass < Puppet::Parser::AST::Definition
end
end
+ # Make sure our parent class has been evaluated, if we have one.
+ def evaluate(scope)
+ if parentclass and ! scope.catalog.resource(:class, parentclass)
+ resource = parentobj.evaluate(scope)
+ end
+
+ super
+ end
+
# Evaluate the code associated with this class.
def evaluate_code(resource)
scope = resource.scope
@@ -58,11 +67,6 @@ class Puppet::Parser::AST::HostClass < Puppet::Parser::AST::Definition
end
end
- def initialize(options)
- @parentclass = nil
- super
- end
-
def parent_scope(scope, klass)
if s = scope.compile.class_scope(klass)
return s