summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-04-07 17:00:01 -0400
committerThomas Wiest <twiest@users.noreply.github.com>2015-04-07 17:00:01 -0400
commit7fd9fa19767556eb948b58717db110ee5d5253f9 (patch)
tree9c4774b2c5c1e487a59d89cb898452c3da5044a0 /bin
parent675f6165a83b86c1a498c327161f928d218ee244 (diff)
parent185261ab927c6997c1bc3eefe2ab4cd804b8a7f0 (diff)
downloadopenshift-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')
-rwxr-xr-xbin/opssh16
1 files changed, 11 insertions, 5 deletions
diff --git a/bin/opssh b/bin/opssh
index d8137fb20..ad1aadc29 100755
--- a/bin/opssh
+++ b/bin/opssh
@@ -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))