Added 2.7 support to catalog indirection call

As of 2.7.x, all indirections should be accessed
through the faces API.
This commit is contained in:
Dan Bode 2011-07-17 22:17:24 -07:00
parent 915b858252
commit 79be9dd45a
1 changed files with 7 additions and 1 deletions

View File

@ -18,8 +18,14 @@ module RSpec::Puppet
node = Puppet::Node.new('test_node')
Puppet::Resource::Catalog.find(node.name, :use_node => node)
node.merge(facts)
# trying to be compatible with 2.7 as well as 2.6
if Puppet::Resource::Catalog.respond_to? :find
Puppet::Resource::Catalog.find(node.name, :use_node => node)
else
require 'puppet/face'
Puppet::Face[:catalog, :current].find(node.name, :use_node => node)
end
end
end
end