Ensure batch uses passed eauth token or credentials

This commit is contained in:
Christian McHugh 2017-04-09 09:23:06 +01:00 committed by rallytime
parent 6df76f6687
commit 5fb8190d44

View file

@ -516,10 +516,14 @@ class LocalClient(object):
if 'gather_job_timeout' in kwargs:
opts['gather_job_timeout'] = kwargs['gather_job_timeout']
eauth=kwargs.get('eauth', {})
if 'token' in kwargs:
eauth['token'] = kwargs['token']
for key, val in six.iteritems(self.opts):
if key not in opts:
opts[key] = val
batch = salt.cli.batch.Batch(opts, quiet=True)
batch = salt.cli.batch.Batch(opts, eauth=eauth, quiet=True)
for ret in batch.run():
yield ret