Merge pull request #19303 from cachedout/batch_ckminions

Batch ckminions
This commit is contained in:
Thomas S Hatch 2015-01-06 10:37:42 -07:00
commit 00e9686488
2 changed files with 6 additions and 19 deletions

View File

@ -13,6 +13,7 @@ import copy
# Import salt libs
import salt.client
import salt.output
import salt.utils.minions
from salt.utils import print_cli
from salt.ext.six.moves import range
@ -32,25 +33,13 @@ class Batch(object):
'''
Return a list of minions to use for the batch run
'''
args = [self.opts['tgt'],
'test.ping',
[],
self.opts['timeout'],
]
ckminions = salt.utils.minions.CkMinions(self.opts)
selected_target_option = self.opts.get('selected_target_option', None)
if selected_target_option is not None:
args.append(selected_target_option)
expr_form = selected_target_option
else:
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)
return sorted(fret)
expr_form = self.opts.get('expr_form', 'glob')
return ckminions.check_minions(self.opts['tgt'], expr_form=expr_form)
def get_bnum(self):
'''

View File

@ -21,9 +21,7 @@ class BatchTest(integration.ShellCase):
'''
Tests executing a simple batch command to help catch regressions
'''
ret = ['sub_minion Detected for this batch run',
'minion Detected for this batch run',
'',
ret = ['',
"Executing run on ['sub_minion']",
'',
'sub_minion:',