ossh.py 977 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env python
  2. import argparse
  3. import ansibleutil
  4. import sys
  5. import os
  6. # use dynamic inventory
  7. # list instances
  8. # symlinked to ~/bin
  9. # list instances that match pattern
  10. # python!
  11. class Ossh(object):
  12. def __init__(self):
  13. self.file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)))
  14. self.parse_cli_args()
  15. self.ansible = ansibleutil.AnsibleUtil()
  16. self.list_hosts()
  17. def parse_cli_args(self):
  18. parser = argparse.ArgumentParser(description='Openshift Online SSH Tool.')
  19. parser.add_argument('-l', '--list', default=True,
  20. action="store_true", help="list out hosts")
  21. self.args = parser.parse_args()
  22. def list_hosts(self):
  23. # TODO: perform a numerical sort on these hosts
  24. # and display them
  25. print self.ansible.get_host_address()
  26. def ssh(self):
  27. pass
  28. def main():
  29. ossh = Ossh()
  30. if __name__ == '__main__':
  31. main()