Fixing #687.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2662 980ebf18-57e1-0310-9a29-db15c13687c0
This commit is contained in:
Родитель
8a7fe9fedf
Коммит
1bcca31952
|
@ -1,3 +1,5 @@
|
|||
External node sources can now return undefined classes (#687).
|
||||
|
||||
Puppet clients now have http proxy support (#701).
|
||||
|
||||
The parser now throws an error when a resource reference
|
||||
|
|
|
@ -28,7 +28,7 @@ class Puppet::Parser::Interpreter
|
|||
|
||||
# Then evaluate the classes.
|
||||
begin
|
||||
options[:scope].function_include(classes)
|
||||
options[:scope].function_include(classes.find_all { |c| options[:scope].findclass(c) })
|
||||
rescue => detail
|
||||
raise Puppet::ParseError, "Could not evaluate classes for %s: %s" % [name, detail]
|
||||
end
|
||||
|
|
|
@ -853,6 +853,18 @@ class TestInterpreter < PuppetTest::TestCase
|
|||
|
||||
assert(scope.classlist.include?("sub"), "NodeDef did not evaluate class")
|
||||
assert(scope.classlist.include?("other"), "NodeDef did not evaluate other class")
|
||||
|
||||
# Now make sure nodedef doesn't fail when some classes are not defined (#687).
|
||||
assert_nothing_raised("Could not create a node definition with some invalid classes") do
|
||||
node = NodeDef.new :name => "yay", :classes => %w{base unknown}
|
||||
end
|
||||
|
||||
scope = mkscope :interp => interp
|
||||
assert_nothing_raised("Could not evaluate the node definition with some invalid classes") do
|
||||
node.evaluate(:scope => scope)
|
||||
end
|
||||
|
||||
assert(scope.classlist.include?("base"), "NodeDef did not evaluate class")
|
||||
end
|
||||
|
||||
# This can stay in the main test suite because it doesn't actually use ldapsearch,
|
||||
|
|
Загрузка…
Ссылка в новой задаче