Merge pull request #535 from martinpfeifer/package_provider_fact

prevent deprecation warning about the allow_virtual parameter
This commit is contained in:
David Schmitt 2015-10-13 10:18:59 +01:00
commit 4e62223801

View file

@ -12,6 +12,10 @@ require 'puppet/type/package'
Facter.add(:package_provider) do
setcode do
Puppet::Type.type(:package).newpackage(:name => 'dummy')[:provider].to_s
if Gem::Version.new(Facter.value(:puppetversion)) >= Gem::Version.new('3.6')
Puppet::Type.type(:package).newpackage(:name => 'dummy', :allow_virtual => 'true')[:provider].to_s
else
Puppet::Type.type(:package).newpackage(:name => 'dummy')[:provider].to_s
end
end
end