From ea823932c2cc971f8fc17abb5af11b9c61ba1f25 Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 21 Mar 2016 16:20:31 -0600 Subject: [PATCH] Improve error on mac_utils --- salt/utils/mac_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/salt/utils/mac_utils.py b/salt/utils/mac_utils.py index 5a21f31355..2bf7bd72f0 100644 --- a/salt/utils/mac_utils.py +++ b/salt/utils/mac_utils.py @@ -115,6 +115,7 @@ def execute_return_success(cmd): msg = 'Command Failed: {0}\n'.format(cmd) msg += 'Return Code: {0}\n'.format(ret['retcode']) msg += 'Output: {0}\n'.format(ret['stdout']) + msg += 'Error: {0}\n'.format(ret['stderr']) raise CommandExecutionError(msg) return True @@ -133,7 +134,10 @@ def execute_return_result(cmd): ret = _run_all(cmd) if ret['retcode'] != 0: - msg = 'Command failed: {0}'.format(ret['stderr']) + msg = 'Command Failed: {0}\n'.format(cmd) + msg += 'Return Code: {0}\n'.format(ret['retcode']) + msg += 'Output: {0}\n'.format(ret['stdout']) + msg += 'Error: {0}\n'.format(ret['stderr']) raise CommandExecutionError(msg) return ret['stdout']