summaryrefslogtreecommitdiff
path: root/lib/chef/provider/package/dpkg.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-06-02 16:36:46 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-06-02 18:52:12 -0700
commit23e3c799803ac1800149e27271c6168539cea25e (patch)
treec6394473fc32f9b30b50a309de765940a21d2c8c /lib/chef/provider/package/dpkg.rb
parent025cabb7158fb02a89250ef91cc94ce3b3c38648 (diff)
downloadchef-23e3c799803ac1800149e27271c6168539cea25e.tar.gz
fix package timeout attribute
updates all the shell_out calls to respect the timeout which is passed on the new_resource. the old `Chef::Config` yum timeout values are still respected and will override the default. the default of 900 seconds is preserved.
Diffstat (limited to 'lib/chef/provider/package/dpkg.rb')
-rw-r--r--lib/chef/provider/package/dpkg.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/provider/package/dpkg.rb b/lib/chef/provider/package/dpkg.rb
index 11691a2479..a262f1ab1a 100644
--- a/lib/chef/provider/package/dpkg.rb
+++ b/lib/chef/provider/package/dpkg.rb
@@ -62,7 +62,7 @@ class Chef
# Get information from the package if supplied
Chef::Log.debug("#{@new_resource} checking dpkg status")
- shell_out("dpkg-deb -W #{@new_resource.source}").stdout.each_line do |line|
+ shell_out_with_timeout("dpkg-deb -W #{@new_resource.source}").stdout.each_line do |line|
if pkginfo = DPKG_INFO.match(line)
@current_resource.package_name(pkginfo[1])
@new_resource.version(pkginfo[2])
@@ -79,7 +79,7 @@ class Chef
# Check to see if it is installed
package_installed = nil
Chef::Log.debug("#{@new_resource} checking install state")
- status = shell_out("dpkg -s #{@current_resource.package_name}")
+ status = shell_out_with_timeout("dpkg -s #{@current_resource.package_name}")
status.stdout.each_line do |line|
case line
when DPKG_INSTALLED
@@ -134,13 +134,13 @@ class Chef
run_noninteractive("dpkg-reconfigure #{name}")
end
- # Runs command via shell_out with magic environment to disable
+ # Runs command via shell_out_with_timeout with magic environment to disable
# interactive prompts. Command is run with default localization rather
# than forcing locale to "C", so command output may not be stable.
#
# FIXME: This should be "LC_ALL" => "en_US.UTF-8" in order to stabilize the output and get UTF-8
def run_noninteractive(command)
- shell_out!(command, :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil })
+ shell_out_with_timeout!(command, :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil })
end
end