diff options
author | Thomas Wiest <twiest@redhat.com> | 2015-05-01 17:23:02 -0400 |
---|---|---|
committer | Thomas Wiest <twiest@redhat.com> | 2015-05-01 17:23:02 -0400 |
commit | e12c6a4ce54959dd073741a8c77ab4f55c739baa (patch) | |
tree | c904c8bcd6dec38dc1c3684dcb0cf442ecb71f11 | |
parent | dad421c863006f9774f2fed9fc32f3de8f871af6 (diff) | |
download | openshift-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-x | bin/ohi | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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() |