diff options
author | Tor Magnus Rakvåg <tm@intility.no> | 2018-05-15 13:26:18 +0200 |
---|---|---|
committer | Tor Magnus Rakvåg <tm@intility.no> | 2018-05-15 13:26:18 +0200 |
commit | e9d197834483052f327cbe4c7a3c03d035383802 (patch) | |
tree | a7abd3698c29d06646c61c2c8505b88a6733916e /lib/chef/provider | |
parent | e726d30dd5c04953d4373abc500fc728e3bef744 (diff) | |
download | chef-e9d197834483052f327cbe4c7a3c03d035383802.tar.gz |
raise on catalog error
Signed-off-by: Tor Magnus Rakvåg <tm@intility.no>
Diffstat (limited to 'lib/chef/provider')
-rw-r--r-- | lib/chef/provider/package/powershell.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/provider/package/powershell.rb b/lib/chef/provider/package/powershell.rb index 9939b2a238..a65146b1e3 100644 --- a/lib/chef/provider/package/powershell.rb +++ b/lib/chef/provider/package/powershell.rb @@ -53,7 +53,9 @@ class Chef # Installs the package specified with the version passed else latest version will be installed def install_package(names, versions) names.each_with_index do |name, index| - powershell_out(build_powershell_package_command("Install-Package '#{name}'", versions[index]), timeout: new_resource.timeout) + cmd = powershell_out(build_powershell_package_command("Install-Package '#{name}'", versions[index]), timeout: new_resource.timeout) + next if cmd.nil? + raise Chef::Exceptions::PowershellCmdletException, "Failed to install package due to catalog signing error, use skip_publisher_check to force install" if cmd.stderr =~ /SkipPublisherCheck/ end end |