summaryrefslogtreecommitdiffstats
path: root/bin/ossh
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2015-02-11 16:11:18 -0500
committerKenny Woodson <kwoodson@redhat.com>2015-02-11 16:11:18 -0500
commitcf65db9573ec99b0f4e2b599b6f158785602c230 (patch)
tree3d648556b45d4209dea96bdbc1b9c92986e129e1 /bin/ossh
parent603c79412df1b141230ec55f032ad086ada37097 (diff)
downloadopenshift-cf65db9573ec99b0f4e2b599b6f158785602c230.tar.gz
openshift-cf65db9573ec99b0f4e2b599b6f158785602c230.tar.bz2
openshift-cf65db9573ec99b0f4e2b599b6f158785602c230.tar.xz
openshift-cf65db9573ec99b0f4e2b599b6f158785602c230.zip
Updated oscp and ossh.
Diffstat (limited to 'bin/ossh')
-rwxr-xr-xbin/ossh17
1 files changed, 7 insertions, 10 deletions
diff --git a/bin/ossh b/bin/ossh
index d74244501..6b04cb46e 100755
--- a/bin/ossh
+++ b/bin/ossh
@@ -24,15 +24,10 @@ class Ossh(object):
# parse host and user
self.process_host()
- if not self.args.list and not self.env:
- print "Please specify an environment."
- return
-
if self.args.host == '' and not self.args.list:
self.parser.print_help()
return
-
if self.args.debug:
print self.args
@@ -176,16 +171,18 @@ class Ossh(object):
for arg in self.args.ssh_opts.split(","):
ssh_args.append("-o%s" % arg)
- result = self.select_host()
- if not result:
+ results = self.select_host()
+ if not results:
return # early exit, no results
- if len(result) > 1:
- self.list_hosts(10)
+ if len(results) > 1:
+ print "Multiple results found for %s." % self.host
+ for result in results:
+ print "{ec2_tag_Name:<35} {ec2_tag_environment:<5} {ec2_id:<10}".format(**result[1])
return # early exit, too many results
# Assume we have one and only one.
- hostname, server_info = result[0]
+ hostname, server_info = results[0]
dns = server_info['ec2_public_dns_name']
ssh_args.append(dns)