summaryrefslogtreecommitdiff
path: root/lib/chef/provider/package.rb
diff options
context:
space:
mode:
authorojab <ojab@ojab.ru>2015-03-27 14:05:14 +0300
committerBryan McLellan <btm@chef.io>2015-05-01 18:45:22 -0400
commit49c9146d86a019dd2bdc80c59b62e2c10bcd5412 (patch)
tree77ec7adeba28ced42838d05d2c3c5fd07ce30e75 /lib/chef/provider/package.rb
parentc70fee6e7b522a62e2c0c90ce3a0e422e2fa5d6c (diff)
downloadchef-49c9146d86a019dd2bdc80c59b62e2c10bcd5412.tar.gz
Fix installation of yum packages with version constraints
Fixes #2778
Diffstat (limited to 'lib/chef/provider/package.rb')
-rw-r--r--lib/chef/provider/package.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb
index 2e8e29981b..6b429a400d 100644
--- a/lib/chef/provider/package.rb
+++ b/lib/chef/provider/package.rb
@@ -464,10 +464,7 @@ class Chef
# @return [Array] new_version(s) as an array
def new_version_array
- @new_version_array ||=
- [ new_resource.version ].flatten.map do |v|
- ( v.nil? || v.empty? ) ? nil : v
- end
+ [ new_resource.version ].flatten.map { |v| v.to_s.empty? ? nil : v }
end
# @todo: extract apt/dpkg specific preseeding to a helper class