summaryrefslogtreecommitdiffstats
path: root/bin/ohi
diff options
context:
space:
mode:
authorWesley Hearn <wesley.s.hearn@gmail.com>2015-05-06 10:27:42 -0400
committerWesley Hearn <wesley.s.hearn@gmail.com>2015-05-06 10:27:42 -0400
commit1d8e743921a48a5abd2ca75323321f6db261101b (patch)
tree8f3370fd2d9537a568d97e48ece9e18f3d0032bb /bin/ohi
parent196d37e2ffa0d7f4221a857b143fd09f84a9d00b (diff)
parente0b2d98a6cac21cfa555afe4d660cb62c1180856 (diff)
downloadopenshift-1d8e743921a48a5abd2ca75323321f6db261101b.tar.gz
openshift-1d8e743921a48a5abd2ca75323321f6db261101b.tar.bz2
openshift-1d8e743921a48a5abd2ca75323321f6db261101b.tar.xz
openshift-1d8e743921a48a5abd2ca75323321f6db261101b.zip
Merge pull request #208 from openshift/master
Merge Master Into INT
Diffstat (limited to 'bin/ohi')
-rwxr-xr-xbin/ohi15
1 files changed, 13 insertions, 2 deletions
diff --git a/bin/ohi b/bin/ohi
index 408961ee4..bb52166df 100755
--- a/bin/ohi
+++ b/bin/ohi
@@ -12,12 +12,15 @@ import subprocess
import ConfigParser
from openshift_ansible import awsutil
+from openshift_ansible import utils
from openshift_ansible.awsutil import ArgumentError
CONFIG_MAIN_SECTION = 'main'
CONFIG_HOST_TYPE_ALIAS_SECTION = 'host_type_aliases'
CONFIG_INVENTORY_OPTION = 'inventory'
+
+
class Ohi(object):
def __init__(self):
self.inventory = None
@@ -60,8 +63,12 @@ class Ohi(object):
# We weren't able to determine what they wanted to do
raise ArgumentError("Invalid combination of arguments")
- for host in hosts:
- print host
+ for host in sorted(hosts, key=utils.normalize_dnsname):
+ if self.args.user:
+ print "%s@%s" % (self.args.user, host)
+ else:
+ print host
+
return 0
def parse_config_file(self):
@@ -94,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()