diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2014-10-13 09:38:29 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2014-10-13 09:38:29 -0700 |
commit | 06456f33dc387b17162184b62941aae66f995ec8 (patch) | |
tree | 1c8207dc39cc385e6699ebba7af30256b412e66f /lib/chef/util | |
parent | 0570d5ca7f040ba1d6a677f5094616364dc1582f (diff) | |
parent | 997b0e0cf1a99e13e8ce5e0f859deb4a225792a4 (diff) | |
download | chef-06456f33dc387b17162184b62941aae66f995ec8.tar.gz |
Merge pull request #2190 from opscode/jdmundrawala/issue-2169
Try to apply dsc configuration even if what-if fails
Diffstat (limited to 'lib/chef/util')
-rw-r--r-- | lib/chef/util/dsc/local_configuration_manager.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/util/dsc/local_configuration_manager.rb b/lib/chef/util/dsc/local_configuration_manager.rb index 4a56b6a397..7395dd5bbf 100644 --- a/lib/chef/util/dsc/local_configuration_manager.rb +++ b/lib/chef/util/dsc/local_configuration_manager.rb @@ -29,7 +29,7 @@ class Chef::Util::DSC def test_configuration(configuration_document) status = run_configuration_cmdlet(configuration_document) - handle_what_if_exception!(status.stderr) unless status.succeeded? + log_what_if_exception(status.stderr) unless status.succeeded? configuration_update_required?(status.return_value) end @@ -78,14 +78,14 @@ $ProgressPreference = 'SilentlyContinue';start-dscconfiguration -path #{@configu EOH end - def handle_what_if_exception!(what_if_exception_output) + def log_what_if_exception(what_if_exception_output) if what_if_exception_output.gsub(/\s+/, ' ') =~ /A parameter cannot be found that matches parameter name 'Whatif'/i # LCM returns an error if any of the resources do not support the opptional What-If Chef::Log::warn("Received error while testing configuration due to resource not supporting 'WhatIf'") elsif output_has_dsc_module_failure?(what_if_exception_output) Chef::Log::warn("Received error while testing configuration due to a module for an imported resource possibly not being fully installed:\n#{what_if_exception_output.gsub(/\s+/, ' ')}") else - raise Chef::Exceptions::PowershellCmdletException, "Powershell Cmdlet failed: #{what_if_exception_output.gsub(/\s+/, ' ')}" + Chef::Log::warn("Received error while testing configuration:\n#{what_if_exception_output.gsub(/\s+/, ' ')}") end end |