From d3dee2db1c87b074075b3bbcbe8931862ee7eca3 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Fri, 30 Jan 2015 16:29:56 -0500 Subject: Adding ossh.py --- bin/ossh.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 bin/ossh.py (limited to 'bin/ossh.py') diff --git a/bin/ossh.py b/bin/ossh.py new file mode 100755 index 000000000..2a24e807d --- /dev/null +++ b/bin/ossh.py @@ -0,0 +1,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() + -- cgit v1.2.3