summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-05-01 17:25:59 -0400
committerThomas Wiest <twiest@users.noreply.github.com>2015-05-01 17:25:59 -0400
commit39a44ef1b7e64f73a65249bd930fcc6534788053 (patch)
treec904c8bcd6dec38dc1c3684dcb0cf442ecb71f11 /bin
parentb6b53398a023ffef8b5c6e90fb6228f3bee69470 (diff)
parente12c6a4ce54959dd073741a8c77ab4f55c739baa (diff)
downloadopenshift-39a44ef1b7e64f73a65249bd930fcc6534788053.tar.gz
openshift-39a44ef1b7e64f73a65249bd930fcc6534788053.tar.bz2
openshift-39a44ef1b7e64f73a65249bd930fcc6534788053.tar.xz
openshift-39a44ef1b7e64f73a65249bd930fcc6534788053.zip
Merge pull request #201 from twiest/pr
Added --user option to ohi to pre-pend the username in the hostlist output.
Diffstat (limited to 'bin')
-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()