diff options
author | Adam Edwards <adamed@opscode.com> | 2014-08-30 22:54:59 -0700 |
---|---|---|
committer | Adam Edwards <adamed@opscode.com> | 2014-08-30 22:54:59 -0700 |
commit | 4f98c0027c59cd1faad25a3307fecec6942f9f6b (patch) | |
tree | ae830e1db34513d4825538b5806859eaa44ef191 | |
parent | f4cbb7560d007d904979e924ce1dc1e836d7d9fd (diff) | |
download | chef-4f98c0027c59cd1faad25a3307fecec6942f9f6b.tar.gz |
Expose exit_code for cmdlet_result and use to detect DSC resource installation problems
-rw-r--r-- | lib/chef/util/dsc/local_configuration_manager.rb | 2 | ||||
-rw-r--r-- | lib/chef/util/powershell/cmdlet_result.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/util/dsc/local_configuration_manager.rb b/lib/chef/util/dsc/local_configuration_manager.rb index b1b0752be1..d25f144095 100644 --- a/lib/chef/util/dsc/local_configuration_manager.rb +++ b/lib/chef/util/dsc/local_configuration_manager.rb @@ -33,7 +33,7 @@ class Chef::Util::DSC status = run_configuration_cmdlet(configuration_document) command_output = status.return_value unless status.succeeded? - if status.status.exitstatus == LCM_MODULE_NOT_INSTALLED_ERROR_CODE + if status.exit_code == LCM_MODULE_NOT_INSTALLED_ERROR_CODE Chef::Log::warn('Unable to test configuration because a required DSC PowerShell module may not be installed.') command_output = '' end diff --git a/lib/chef/util/powershell/cmdlet_result.rb b/lib/chef/util/powershell/cmdlet_result.rb index 390ee8cbc1..0e9ccc3523 100644 --- a/lib/chef/util/powershell/cmdlet_result.rb +++ b/lib/chef/util/powershell/cmdlet_result.rb @@ -38,6 +38,10 @@ class Chef::Util::Powershell @status.stdout end end + + def exit_code + @status.status.exitstatus + end def succeeded? @succeeded = @status.status.exitstatus == 0 |