summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-05-30 19:03:48 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-05-30 19:03:48 -0700
commit4a9f72b77b0285dceb391f627f51c2e537802825 (patch)
tree6c62d14250617e26c02be99ac24cf4b15a9dfab7 /lib/chef/provider
parenta2865ad2ae40ec78ecdfba6d58853df51699b8eb (diff)
downloadchef-4a9f72b77b0285dceb391f627f51c2e537802825.tar.gz
fixing yum splat args
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/package/yum.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/provider/package/yum.rb b/lib/chef/provider/package/yum.rb
index 983d7149c1..ab206bb858 100644
--- a/lib/chef/provider/package/yum.rb
+++ b/lib/chef/provider/package/yum.rb
@@ -117,10 +117,10 @@ class Chef
end
if new_resource.source
- yum(options, "-y #{method}", new_resource.source)
+ yum(options, "-y", method, new_resource.source)
else
resolved_names = names.each_with_index.map { |name, i| available_version(i).to_s unless name.nil? }
- yum(options, "-y #{method}", resolved_names)
+ yum(options, "-y", method, resolved_names)
end
flushcache
end
@@ -130,7 +130,7 @@ class Chef
def remove_package(names, versions)
resolved_names = names.each_with_index.map { |name, i| installed_version(i).to_s unless name.nil? }
- yum(options, "-y remove", resolved_names)
+ yum(options, "-y", "remove", resolved_names)
flushcache
end
@@ -143,14 +143,14 @@ class Chef
# NB: the yum_package provider manages individual single packages, please do not submit issues or PRs to try to add wildcard
# support to lock / unlock. The best solution is to write an execute resource which does a not_if `yum versionlock | grep '^pattern`` kind of approach
def lock_package(names, versions)
- yum("-d0 -e0 -y", options, "versionlock add", resolved_package_lock_names(names))
+ yum("-d0", "-e0", "-y", options, "versionlock", "add", resolved_package_lock_names(names))
end
# NB: the yum_package provider manages individual single packages, please do not submit issues or PRs to try to add wildcard
# support to lock / unlock. The best solution is to write an execute resource which does a only_if `yum versionlock | grep '^pattern`` kind of approach
def unlock_package(names, versions)
# yum versionlock delete on rhel6 needs the glob nonsense in the following command
- yum("-d0 -e0 -y", options, "versionlock delete", resolved_package_lock_names(names).map { |n| "'*:#{n}-*'" })
+ yum("-d0", "-e0", "-y", options, "versionlock", "delete", resolved_package_lock_names(names).map { |n| "'*:#{n}-*'" })
end
private
@@ -171,7 +171,7 @@ class Chef
def locked_packages
@locked_packages ||=
begin
- locked = shell_out_with_timeout!("yum versionlock list")
+ locked = yum("versionlock", "list")
locked.stdout.each_line.map do |line|
line.sub(/-[^-]*-[^-]*$/, "").split(":").last.strip
end