diff options
author | Thomas Wiest <twiest@users.noreply.github.com> | 2015-04-07 17:00:01 -0400 |
---|---|---|
committer | Thomas Wiest <twiest@users.noreply.github.com> | 2015-04-07 17:00:01 -0400 |
commit | 7fd9fa19767556eb948b58717db110ee5d5253f9 (patch) | |
tree | 9c4774b2c5c1e487a59d89cb898452c3da5044a0 /bin/opssh | |
parent | 675f6165a83b86c1a498c327161f928d218ee244 (diff) | |
parent | 185261ab927c6997c1bc3eefe2ab4cd804b8a7f0 (diff) | |
download | openshift-7fd9fa19767556eb948b58717db110ee5d5253f9.tar.gz openshift-7fd9fa19767556eb948b58717db110ee5d5253f9.tar.bz2 openshift-7fd9fa19767556eb948b58717db110ee5d5253f9.tar.xz openshift-7fd9fa19767556eb948b58717db110ee5d5253f9.zip |
Merge pull request #138 from twiest/pr
fixed the opssh default output behavior to be consistent with pssh. Also fixed a bug in how directories are named for --outdir and --errdir.
Diffstat (limited to 'bin/opssh')
-rwxr-xr-x | bin/opssh | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -57,13 +57,16 @@ class Opssh(object): """ # Default set of options - pssh_args = [PSSH, '-i', '-t', '0', '-p', str(self.args.par), '--user', self.args.user] + pssh_args = [PSSH, '-t', '0', '-p', str(self.args.par), '--user', self.args.user] + + if self.args.inline: + pssh_args.append("--inline") if self.args.outdir: - pssh_args.append("--outdir='%s'" % self.args.outdir) + pssh_args.extend(["--outdir", self.args.outdir]) if self.args.errdir: - pssh_args.append("--errdir='%s'" % self.args.errdir) + pssh_args.extend(["--errdir", self.args.errdir]) hosts = self.aws.get_host_list(self.args.host_type, self.args.env) with tempfile.NamedTemporaryFile(prefix='opssh-', delete=True) as f: @@ -71,8 +74,8 @@ class Opssh(object): f.write(h + os.linesep) f.flush() - pssh_args.extend(["-h", "%s" % f.name]) - pssh_args.append("%s" % self.args.command) + pssh_args.extend(["-h", f.name]) + pssh_args.append(self.args.command) print print "Running: %s" % ' '.join(pssh_args) @@ -117,6 +120,9 @@ class Opssh(object): parser.add_argument('--user', action='store', default='root', help='username') + parser.add_argument('-i', '--inline', default=False, action='store_true', + help='inline aggregated output and error for each server') + parser.add_argument('-p', '--par', action='store', default=DEFAULT_PSSH_PAR, help=('max number of parallel threads (default %s)' % DEFAULT_PSSH_PAR)) |