mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #15679 from thatch45/ssh_static
Add --static to salt-ssh
This commit is contained in:
commit
16939408f8
@ -451,22 +451,32 @@ class SSH(object):
|
||||
print(msg)
|
||||
print('-' * len(msg) + '\n')
|
||||
print('')
|
||||
sret = {}
|
||||
outputter = self.opts.get('output', 'nested')
|
||||
for ret in self.handle_ssh():
|
||||
host = ret.keys()[0]
|
||||
self.cache_job(jid, host, ret[host])
|
||||
ret = self.key_deploy(host, ret)
|
||||
outputter = ret[host].get('out', self.opts.get('output', 'nested'))
|
||||
p_data = {host: ret[host].get('return', {})}
|
||||
salt.output.display_output(
|
||||
p_data,
|
||||
outputter,
|
||||
self.opts)
|
||||
if self.opts.get('static'):
|
||||
sret.update(p_data)
|
||||
else:
|
||||
salt.output.display_output(
|
||||
p_data,
|
||||
outputter,
|
||||
self.opts)
|
||||
if self.event:
|
||||
self.event.fire_event(
|
||||
ret,
|
||||
salt.utils.event.tagify(
|
||||
[jid, 'ret', host],
|
||||
'job'))
|
||||
if self.opts.get('static'):
|
||||
salt.output.display_output(
|
||||
sret,
|
||||
outputter,
|
||||
self.opts)
|
||||
|
||||
|
||||
class Single(object):
|
||||
|
@ -2183,6 +2183,13 @@ class SaltSSHOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
|
||||
action='store_true',
|
||||
help=('Turn on command verbosity, display jid')
|
||||
)
|
||||
self.add_option(
|
||||
'-s', '--static',
|
||||
default=False,
|
||||
action='store_true',
|
||||
help=('Return the data from minions as a group after they '
|
||||
'all return.')
|
||||
)
|
||||
|
||||
auth_group = optparse.OptionGroup(
|
||||
self, 'Authentication Options',
|
||||
|
Loading…
Reference in New Issue
Block a user