From 2ad173194713606968777a4bbd752bf5e5e58618 Mon Sep 17 00:00:00 2001 From: Thomas S Hatch Date: Wed, 10 Sep 2014 17:38:40 -0600 Subject: [PATCH 1/2] Add --static to salt-ssh options --- salt/utils/parsers.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/salt/utils/parsers.py b/salt/utils/parsers.py index 65c2db50cb..f7e636adad 100644 --- a/salt/utils/parsers.py +++ b/salt/utils/parsers.py @@ -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', From 2a805059470f9772f1577fcc92b0b39cc7166c53 Mon Sep 17 00:00:00 2001 From: Thomas S Hatch Date: Wed, 10 Sep 2014 17:42:03 -0600 Subject: [PATCH 2/2] Add static logic to salt-ssh runtime frontend --- salt/client/ssh/__init__.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py index 28b1ef8bbd..860ec58f31 100644 --- a/salt/client/ssh/__init__.py +++ b/salt/client/ssh/__init__.py @@ -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):