Catch no minions exception in batch mode

Closes #31219
This commit is contained in:
Mike Place 2016-06-03 14:22:11 -06:00
parent 47d668e071
commit 15a39f8646

View file

@ -79,7 +79,10 @@ class SaltCMD(parsers.SaltCMDOptionParser):
if not self.options.batch:
self.config['batch'] = '100%'
batch = salt.cli.batch.Batch(self.config, eauth=eauth, quiet=True)
try:
batch = salt.cli.batch.Batch(self.config, eauth=eauth, quiet=True)
except salt.exceptions.SaltClientError as exc:
sys.exit(2)
ret = {}