mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
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:
commit
6263382858
@ -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']))
|
||||
|
@ -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%'))
|
||||
|
Loading…
Reference in New Issue
Block a user