diff options
Diffstat (limited to 'lib/chef/provider')
-rw-r--r-- | lib/chef/provider/package/cab.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/provider/package/cab.rb b/lib/chef/provider/package/cab.rb index 79292293d2..cfc629b9ef 100644 --- a/lib/chef/provider/package/cab.rb +++ b/lib/chef/provider/package/cab.rb @@ -74,9 +74,13 @@ class Chef end def dism_command(command) - shellout = Mixlib::ShellOut.new("dism.exe /Online /English #{command} /NoRestart", timeout: new_resource.timeout) with_os_architecture(nil) do - shellout.run_command + 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") + result.error! + end + result end end |