summaryrefslogtreecommitdiff
path: root/lib/chef/provider/package.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-12-14 16:48:26 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-12-14 16:48:26 -0800
commitb3d72d3b30eaf257642424eedc574d72f66de4e0 (patch)
tree624cd17189eddaf4ec5f4816bb44e1555d214118 /lib/chef/provider/package.rb
parente4a442d4d70dda5cd1ddc0799690216281a504ec (diff)
downloadchef-b3d72d3b30eaf257642424eedc574d72f66de4e0.tar.gz
refactor to use array indexes instead of package_names
fixes arch array support. pretty sure that my "helpfully" compacting out nils from the names and versions passed to install_package / remove_package was a design flaw now. all of the helpers i've created to translate from package_name to various arrays also assumes the package_name is a unique identifier which is what was going wrong here, and is wrong. best to just have all the arrays indexed the same. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider/package.rb')
-rw-r--r--lib/chef/provider/package.rb18
1 files changed, 0 insertions, 18 deletions
diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb
index 619653574b..f52614672a 100644
--- a/lib/chef/provider/package.rb
+++ b/lib/chef/provider/package.rb
@@ -635,24 +635,6 @@ class Chef
end
args
end
-
- # Helper to construct Hash of names-to-versions, requested on the new_resource.
- # If new_resource.version is nil, then all values will be nil.
- #
- # @return [Hash] Mapping of requested names to versions
- def desired_name_versions
- desired_versions = as_array(new_resource.version) || as_array(new_resource.package_name).map { nil }
- Hash[*as_array(new_resource.package_name).zip(desired_versions).flatten]
- end
-
- # Helper to construct Hash of names-to-arches, requested on the new_resource.
- # If new_resource.arch is nil, then all values will be nil.
- #
- # @return [Hash] Mapping of requested names to versions
- def desired_name_archs
- desired_archs = as_array(new_resource.arch) || as_array(new_resource.package_name).map { nil }
- Hash[*as_array(new_resource.package_name).zip(desired_archs).flatten]
- end
end
end
end