Merge pull request #18918 from cachedout/salt_cli_retcode

Make salt cli return a non-zero error code if an error occurred
This commit is contained in:
Thomas S Hatch 2014-12-17 14:36:51 -07:00
commit 6263382858
2 changed files with 6 additions and 0 deletions

View File

@ -895,6 +895,8 @@ class LocalClient(object):
ret = {raw['data']['id']: {'ret': raw['data']['return']}}
if 'out' in raw['data']:
ret[raw['data']['id']]['out'] = raw['data']['out']
if 'retcode' in raw['data']:
ret[raw['data']['id']]['retcode'] = raw['data']['retcode']
if kwargs.get('_cmd_meta', False):
ret[raw['data']['id']].update(raw['data'])
log.debug('jid {0} return from {1}'.format(jid, raw['data']['id']))

View File

@ -27,11 +27,15 @@ class BatchTest(integration.ShellCase):
"Executing run on ['sub_minion']",
'',
'sub_minion:',
'retcode:',
' 0',
' batch testing',
'',
"Executing run on ['minion']",
'',
'minion:',
'retcode:',
' 0',
' batch testing']
ret = sorted(ret)
cmd = sorted(self.run_salt('\'*\' test.echo \'batch testing\' -b 50%'))