diff --git a/salt/cli/batch.py b/salt/cli/batch.py index c10d56b15a..b254614f0f 100644 --- a/salt/cli/batch.py +++ b/salt/cli/batch.py @@ -12,7 +12,6 @@ import copy # Import salt libs import salt.client import salt.output -import salt.utils.minions from salt.utils import print_cli @@ -31,13 +30,26 @@ class Batch(object): ''' Return a list of minions to use for the batch run ''' - ckminions = salt.utils.minions.CkMinions(self.opts) + args = [self.opts['tgt'], + 'test.ping', + [], + self.opts['timeout'], + ] + selected_target_option = self.opts.get('selected_target_option', None) if selected_target_option is not None: - expr_form = selected_target_option + args.append(selected_target_option) else: - expr_form = self.opts.get('expr_form', 'glob') - return ckminions.check_minions(self.opts['tgt'], expr_form=expr_form) + args.append(self.opts.get('expr_form', 'glob')) + + fret = [] + for ret in self.local.cmd_iter(*args, **self.eauth): + for minion in ret: + if not self.quiet: + print_cli('{0} Detected for this batch run'.format(minion)) + fret.append(minion) + # Returns + return sorted(frozenset(fret)) def get_bnum(self): '''