summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorDavid Crowder <david.crowder@cerner.com>2014-12-22 16:08:08 -0600
committertyler-ball <tyleraball@gmail.com>2015-01-28 11:44:45 -0800
commitd3901d01235acaa5d00f5ebe802bb2c29aa48cc5 (patch)
tree0745ad92f895064e33389adcab455e207e3ea790 /lib/chef/provider
parenta569c90518b0b4c841f51554338399afa6a74db2 (diff)
downloadchef-d3901d01235acaa5d00f5ebe802bb2c29aa48cc5.tar.gz
use shell_out! where appropriate and revert incorrectly scoped variable
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/package/rpm.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/provider/package/rpm.rb b/lib/chef/provider/package/rpm.rb
index 6e2f249c43..2ece8f7a7a 100644
--- a/lib/chef/provider/package/rpm.rb
+++ b/lib/chef/provider/package/rpm.rb
@@ -59,8 +59,8 @@ class Chef
end
Chef::Log.debug("#{@new_resource} checking rpm status")
- status = shell_out("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' #{@new_resource.source}")
- status.stdout.split('\n').each do |line|
+ status = shell_out!("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' #{@new_resource.source}")
+ status.stdout.each_line do |line|
case line
when /^([\w\d+_.-]+)\s([\w\d_.-]+)$/
@current_resource.package_name($1)
@@ -77,7 +77,7 @@ class Chef
Chef::Log.debug("#{@new_resource} checking install state")
@rpm_status = shell_out("rpm -q --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' #{@current_resource.package_name}")
- @rpm_status.stdout.split('\n').each do |line|
+ @rpm_status.stdout.each_line do |line|
case line
when /^([\w\d+_.-]+)\s([\w\d_.-]+)$/
Chef::Log.debug("#{@new_resource} current version is #{$2}")