summaryrefslogtreecommitdiffstats
path: root/bin/ossh.py
blob: 2a24e807dccb0a9692515e8c2adc9467c24211ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python

import argparse
import ansibleutil
import sys
import os


# use dynamic inventory
# list instances
# symlinked to ~/bin
# list instances that match pattern
# python!


class Ossh(object):
    def __init__(self):
        self.file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)))
        self.parse_cli_args()
        self.ansible = ansibleutil.AnsibleUtil()

        self.list_hosts()
        
    def parse_cli_args(self):
        parser = argparse.ArgumentParser(description='Openshift Online SSH Tool.')
        parser.add_argument('-l', '--list', default=True, 
                          action="store_true", help="list out hosts")

        self.args = parser.parse_args()

    def list_hosts(self):
        # TODO: perform a numerical sort on these hosts
        # and display them
        print self.ansible.get_host_address()

    def ssh(self):
        pass

def main():
    ossh = Ossh()


if __name__ == '__main__':
    main()