summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordheerajd-msys <dheeraj.dubey@msystechnologies.com>2020-04-14 18:29:17 +0530
committerTim Smith <tsmith84@gmail.com>2020-06-23 16:13:02 -0700
commitc4cf61a552c3c2c5aed3d7f086f4fcb5ed9655ca (patch)
tree75e433e340d3d0d3ddfd6d1fce2985ff6f03fbb1 /lib
parentb3bf62917c9ba424029b27fd781dcd7ed507f4b1 (diff)
downloadchef-c4cf61a552c3c2c5aed3d7f086f4fcb5ed9655ca.tar.gz
add timeout propertymsu_15
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/provider/package/cab.rb2
-rw-r--r--lib/chef/provider/package/msu.rb1
-rw-r--r--lib/chef/resource/msu_package.rb5
3 files changed, 7 insertions, 1 deletions
diff --git a/lib/chef/provider/package/cab.rb b/lib/chef/provider/package/cab.rb
index 31e5d57b16..b1cd791c4b 100644
--- a/lib/chef/provider/package/cab.rb
+++ b/lib/chef/provider/package/cab.rb
@@ -75,7 +75,7 @@ class Chef
def dism_command(command)
with_os_architecture(nil) do
- result = shell_out("dism.exe /Online /English #{command} /NoRestart", { timeout: new_resource.timeout || 3600 })
+ result = shell_out("dism.exe /Online /English #{command} /NoRestart", { timeout: new_resource.timeout })
if result.exitstatus == -2146498530
raise Chef::Exceptions::Package, "The specified package is not applicable to this image." if result.stdout.include?("0x800f081e")
diff --git a/lib/chef/provider/package/msu.rb b/lib/chef/provider/package/msu.rb
index 0ac77e90f4..c5345d884e 100644
--- a/lib/chef/provider/package/msu.rb
+++ b/lib/chef/provider/package/msu.rb
@@ -109,6 +109,7 @@ class Chef
@cab_files.each do |cab_file|
declare_resource(:cab_package, new_resource.name) do
source cab_file
+ timeout new_resource.timeout
action :install
end
end
diff --git a/lib/chef/resource/msu_package.rb b/lib/chef/resource/msu_package.rb
index 12cd0bc590..6028f3853b 100644
--- a/lib/chef/resource/msu_package.rb
+++ b/lib/chef/resource/msu_package.rb
@@ -44,6 +44,11 @@ class Chef
property :checksum, String, desired_state: false,
description: "SHA-256 digest used to verify the checksum of the downloaded MSU package."
+
+ property :timeout, [String, Integer],
+ default: 3600,
+ description: "The amount of time (in seconds) to wait before timing out.",
+ desired_state: false
end
end
end