summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-27 16:30:09 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-27 16:30:09 +0000
commit4c885b7aa48746b6b946c7b2b0cd0abc50216ecf (patch)
treecde888752d334b42570c702dbd9531d73363b544 /lib
parentaad512371967156a39ae422f0a3ca95891f4064d (diff)
downloadpuppet-4c885b7aa48746b6b946c7b2b0cd0abc50216ecf.tar.gz
puppet-4c885b7aa48746b6b946c7b2b0cd0abc50216ecf.tar.xz
puppet-4c885b7aa48746b6b946c7b2b0cd0abc50216ecf.zip
Fixing #517 and more. Classes now support more than one namespace in their search path, parent classes automatically have their namespaces added to subclass namespaces, and (huzzah) there is a "search" function that can be used to add new namespaces into their search path.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2226 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/parser/ast/hostclass.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/puppet/parser/ast/hostclass.rb b/lib/puppet/parser/ast/hostclass.rb
index 65dd27542..526265c1c 100644
--- a/lib/puppet/parser/ast/hostclass.rb
+++ b/lib/puppet/parser/ast/hostclass.rb
@@ -30,11 +30,13 @@ class Puppet::Parser::AST
return nil
end
+ pnames = nil
if @parentclass
if pklass = self.parentclass
pklass.safeevaluate :scope => scope
scope = parent_scope(scope, pklass)
+ pnames = scope.namespaces
else
parsefail "Could not find class %s" % @parentclass
end
@@ -44,6 +46,12 @@ class Puppet::Parser::AST
scope = subscope(scope)
end
+ if pnames
+ pnames.each do |ns|
+ scope.add_namespace(ns)
+ end
+ end
+
# Set the class before we do anything else, so that it's set
# during the evaluation and can be inspected.
scope.setclass(self)