summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wiest <twiest@redhat.com>2015-05-01 17:23:02 -0400
committerThomas Wiest <twiest@redhat.com>2015-05-01 17:23:02 -0400
commite12c6a4ce54959dd073741a8c77ab4f55c739baa (patch)
treec904c8bcd6dec38dc1c3684dcb0cf442ecb71f11
parentdad421c863006f9774f2fed9fc32f3de8f871af6 (diff)
downloadopenshift-e12c6a4ce54959dd073741a8c77ab4f55c739baa.tar.gz
openshift-e12c6a4ce54959dd073741a8c77ab4f55c739baa.tar.bz2
openshift-e12c6a4ce54959dd073741a8c77ab4f55c739baa.tar.xz
openshift-e12c6a4ce54959dd073741a8c77ab4f55c739baa.zip
Added --user option to ohi to pre-pend the username in the hostlist output.
-rwxr-xr-xbin/ohi10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/ohi b/bin/ohi
index af1fb8068..bb52166df 100755
--- a/bin/ohi
+++ b/bin/ohi
@@ -64,7 +64,11 @@ class Ohi(object):
raise ArgumentError("Invalid combination of arguments")
for host in sorted(hosts, key=utils.normalize_dnsname):
- print host
+ if self.args.user:
+ print "%s@%s" % (self.args.user, host)
+ else:
+ print host
+
return 0
def parse_config_file(self):
@@ -97,6 +101,10 @@ class Ohi(object):
parser.add_argument('-t', '--host-type', action="store",
help="Which host type to use")
+ parser.add_argument('-l', '--user', action='store', default=None,
+ help='username')
+
+
self.args = parser.parse_args()