diff options
Diffstat (limited to 'lib/chef/util/dsc/local_configuration_manager.rb')
-rw-r--r-- | lib/chef/util/dsc/local_configuration_manager.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/chef/util/dsc/local_configuration_manager.rb b/lib/chef/util/dsc/local_configuration_manager.rb index f498a2bfea..f8398341e5 100644 --- a/lib/chef/util/dsc/local_configuration_manager.rb +++ b/lib/chef/util/dsc/local_configuration_manager.rb @@ -27,14 +27,14 @@ class Chef::Util::DSC clear_execution_time end - def test_configuration(configuration_document) - status = run_configuration_cmdlet(configuration_document) + def test_configuration(configuration_document, shellout_flags) + status = run_configuration_cmdlet(configuration_document, false, shellout_flags) log_what_if_exception(status.stderr) unless status.succeeded? configuration_update_required?(status.return_value) end - def set_configuration(configuration_document) - run_configuration_cmdlet(configuration_document, true) + def set_configuration(configuration_document, shellout_flags) + run_configuration_cmdlet(configuration_document, true, shellout_flags) end def last_operation_execution_time_seconds @@ -45,7 +45,7 @@ class Chef::Util::DSC private - def run_configuration_cmdlet(configuration_document, apply_configuration = false) + def run_configuration_cmdlet(configuration_document, apply_configuration, shellout_flags) Chef::Log.debug("DSC: Calling DSC Local Config Manager to #{apply_configuration ? "set" : "test"} configuration document.") test_only_parameters = ! apply_configuration ? '-whatif; if (! $?) { exit 1 }' : '' @@ -57,9 +57,9 @@ class Chef::Util::DSC save_configuration_document(configuration_document) cmdlet = ::Chef::Util::Powershell::Cmdlet.new(@node, "#{command_code}") if apply_configuration - status = cmdlet.run! + status = cmdlet.run!({}, shellout_flags) else - status = cmdlet.run + status = cmdlet.run({}, shellout_flags) end ensure end_operation_timing @@ -103,7 +103,7 @@ EOH Chef::Log.debug("DSC: DSC returned the following '-whatif' output from test operation:\n#{what_if_output}") begin Parser::parse(what_if_output) - rescue Chef::Util::DSC::LocalConfigurationManager::Parser => e + rescue Chef::Exceptions::LCMParser => e Chef::Log::warn("Could not parse LCM output: #{e}") [Chef::Util::DSC::ResourceInfo.new('Unknown DSC Resources', true, ['Unknown changes because LCM output was not parsable.'])] end |