From 9d9447fd7ce9bb63dd9196fa702b6def121a06bb Mon Sep 17 00:00:00 2001 From: Mike Place Date: Thu, 11 Dec 2014 11:38:33 -0700 Subject: [PATCH 1/2] Make salt cli return a non-zero error code if an error occurred --- salt/client/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/salt/client/__init__.py b/salt/client/__init__.py index 630969d798..16a7d274ba 100644 --- a/salt/client/__init__.py +++ b/salt/client/__init__.py @@ -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'])) From 302d5cab39429b4937fac043ebf64ac72e3ef1c7 Mon Sep 17 00:00:00 2001 From: Mike Place Date: Mon, 15 Dec 2014 12:04:35 -0700 Subject: [PATCH 2/2] Fix failing test --- tests/integration/cli/batch.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/integration/cli/batch.py b/tests/integration/cli/batch.py index bbbaf90ded..0b43c8109e 100644 --- a/tests/integration/cli/batch.py +++ b/tests/integration/cli/batch.py @@ -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%'))