Skip to content

Commit

Permalink
prevent deprecation warning about the allow_virtual parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mapfatdm committed Oct 13, 2015
1 parent e1a9bf5 commit d73fd3c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/facter/package_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

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

0 comments on commit d73fd3c

Please sign in to comment.