summaryrefslogtreecommitdiff
path: root/lib/chef/provider/package/smartos.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/smartos.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/smartos.rb')
-rw-r--r--lib/chef/provider/package/smartos.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/provider/package/smartos.rb b/lib/chef/provider/package/smartos.rb
index bba55ca39e..0d5b801c96 100644
--- a/lib/chef/provider/package/smartos.rb
+++ b/lib/chef/provider/package/smartos.rb
@@ -43,7 +43,7 @@ class Chef
def check_package_state(name)
Chef::Log.debug("#{@new_resource} checking package #{name}")
version = nil
- info = shell_out!("/opt/local/sbin/pkg_info", "-E", "#{name}*", :env => nil, :returns => [0,1])
+ info = shell_out_with_timeout!("/opt/local/sbin/pkg_info", "-E", "#{name}*", :env => nil, :returns => [0,1])
if info.stdout
version = info.stdout[/^#{@new_resource.package_name}-(.+)/, 1]
@@ -60,7 +60,7 @@ class Chef
return @candidate_version if @candidate_version
name = nil
version = nil
- pkg = shell_out!("/opt/local/bin/pkgin", "se", new_resource.package_name, :env => nil, :returns => [0,1])
+ pkg = shell_out_with_timeout!("/opt/local/bin/pkgin", "se", new_resource.package_name, :env => nil, :returns => [0,1])
pkg.stdout.each_line do |line|
case line
when /^#{new_resource.package_name}/
@@ -74,7 +74,7 @@ class Chef
def install_package(name, version)
Chef::Log.debug("#{@new_resource} installing package #{name} version #{version}")
package = "#{name}-#{version}"
- out = shell_out!("/opt/local/bin/pkgin", "-y", "install", package, :env => nil)
+ out = shell_out_with_timeout!("/opt/local/bin/pkgin", "-y", "install", package, :env => nil)
end
def upgrade_package(name, version)
@@ -85,7 +85,7 @@ class Chef
def remove_package(name, version)
Chef::Log.debug("#{@new_resource} removing package #{name} version #{version}")
package = "#{name}"
- out = shell_out!("/opt/local/bin/pkgin", "-y", "remove", package, :env => nil)
+ out = shell_out_with_timeout!("/opt/local/bin/pkgin", "-y", "remove", package, :env => nil)
end
end