diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/package/cab.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/package/msu.rb | 1 | ||||
-rw-r--r-- | lib/chef/resource/msu_package.rb | 5 |
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 |