Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
Follow my own advice and use the correct API to get the class to use.
Browse files Browse the repository at this point in the history
  • Loading branch information
coderanger committed Feb 13, 2017
1 parent 3aa30b3 commit 85bf27f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/poise_languages/system/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,19 @@ def package_resources(action)
end

Chef::Log.debug("[#{new_resource.parent}] Building package resource using #{packages.inspect}.")
package_resource_class = Chef::Resource.resource_for_node(:package, node)
@package_resource ||= if node.platform_family?('rhel', 'fedora', 'amazon', 'mac_os_x')
# @todo Can't use multi-package mode with yum pending https://github.com/chef/chef/issues/3476.
packages.map do |name, version|
Chef::Resource::Package.new(name, run_context).tap do |r|
package_resource_class.new(name, run_context).tap do |r|
r.version(version)
r.action(action)
r.declared_type = :package
r.retries(5)
end
end
else
[Chef::Resource::Package.new(packages.keys, run_context).tap do |r|
[package_resource_class.new(packages.keys, run_context).tap do |r|
r.version(packages.values)
r.action(action)
r.declared_type = :package
Expand Down

0 comments on commit 85bf27f

Please sign in to comment.