diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-06-02 16:36:46 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-06-02 18:52:12 -0700 |
commit | 23e3c799803ac1800149e27271c6168539cea25e (patch) | |
tree | c6394473fc32f9b30b50a309de765940a21d2c8c /lib/chef/provider/package/apt.rb | |
parent | 025cabb7158fb02a89250ef91cc94ce3b3c38648 (diff) | |
download | chef-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/apt.rb')
-rw-r--r-- | lib/chef/provider/package/apt.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/provider/package/apt.rb b/lib/chef/provider/package/apt.rb index e426b51992..bd6ed283bf 100644 --- a/lib/chef/provider/package/apt.rb +++ b/lib/chef/provider/package/apt.rb @@ -62,7 +62,7 @@ class Chef installed_version = nil candidate_version = nil - shell_out!("apt-cache#{expand_options(default_release_options)} policy #{pkg}", {:timeout=>900}).stdout.each_line do |line| + shell_out_with_timeout!("apt-cache#{expand_options(default_release_options)} policy #{pkg}").stdout.each_line do |line| case line when /^\s{2}Installed: (.+)$/ installed_version = $1 @@ -78,7 +78,7 @@ class Chef if candidate_version == '(none)' # This may not be an appropriate assumption, but it shouldn't break anything that already worked -- btm is_virtual_package = true - showpkg = shell_out!("apt-cache showpkg #{pkg}", {:timeout => 900}).stdout + showpkg = shell_out_with_timeout!("apt-cache showpkg #{pkg}").stdout providers = Hash.new showpkg.rpartition(/Reverse Provides: ?#{$/}/)[2].each_line do |line| provider, version = line.split @@ -175,7 +175,7 @@ class Chef # interactive prompts. Command is run with default localization rather # than forcing locale to "C", so command output may not be stable. def run_noninteractive(command) - shell_out!(command, :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, :timeout => @new_resource.timeout) + shell_out_with_timeout!(command, :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }) end end |