summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wiest <twiest@redhat.com>2015-04-07 16:51:40 -0400
committerThomas Wiest <twiest@redhat.com>2015-04-07 16:59:20 -0400
commit185261ab927c6997c1bc3eefe2ab4cd804b8a7f0 (patch)
tree9c4774b2c5c1e487a59d89cb898452c3da5044a0
parent675f6165a83b86c1a498c327161f928d218ee244 (diff)
downloadopenshift-185261ab927c6997c1bc3eefe2ab4cd804b8a7f0.tar.gz
openshift-185261ab927c6997c1bc3eefe2ab4cd804b8a7f0.tar.bz2
openshift-185261ab927c6997c1bc3eefe2ab4cd804b8a7f0.tar.xz
openshift-185261ab927c6997c1bc3eefe2ab4cd804b8a7f0.zip
fixed the opssh default output behavior to be consistent with pssh. Also fixed a bug in how directories are named for --outdir and --errdir.
-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))