summaryrefslogtreecommitdiffstats
path: root/bin/opssh.py
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2015-02-05 17:01:06 -0500
committerKenny Woodson <kwoodson@redhat.com>2015-02-05 17:01:06 -0500
commitcedef18d9450a1b3c8c0f72c10174735529cda04 (patch)
tree6470a05c3308ec9c45c871b3b842182de6284876 /bin/opssh.py
parentee96928a2d1c21c5d2319418f4cf6ca774a3e010 (diff)
downloadopenshift-cedef18d9450a1b3c8c0f72c10174735529cda04.tar.gz
openshift-cedef18d9450a1b3c8c0f72c10174735529cda04.tar.bz2
openshift-cedef18d9450a1b3c8c0f72c10174735529cda04.tar.xz
openshift-cedef18d9450a1b3c8c0f72c10174735529cda04.zip
Removed comments and cleaned up code.
Diffstat (limited to 'bin/opssh.py')
-rwxr-xr-xbin/opssh.py66
1 files changed, 0 insertions, 66 deletions
diff --git a/bin/opssh.py b/bin/opssh.py
deleted file mode 100755
index 6ee390c4c..000000000
--- a/bin/opssh.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python
-# vim: expandtab:tabstop=4:shiftwidth=4
-
-import argparse
-import os
-import ansibleutil
-import sys
-
-class Program(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()
-
- inv = self.ansible.get_inventory()
- #print inv.keys()
- #sys.exit()
-
- if self.args.list_environments:
- self.list_environments()
- sys.exit()
-
- if self.args.list_groups:
- self.list_security_groups()
- sys.exit()
-
- def parse_cli_args(self):
- parser = argparse.ArgumentParser(
- description='OpenShift Online Operations Parallel SSH'
- )
-
- parser.add_argument("-v", '--verbosity', action="count",
- help="increase output verbosity")
-
- group = parser.add_mutually_exclusive_group()
-
- group.add_argument('--list-environments', action="store_true",
- help='List all environments')
- group.add_argument('--list-groups', action="store_true",
- help='List all security groups')
- group.add_argument('-e', '--environment',
- help='Set the environment')
-
- self.args = parser.parse_args()
-
- def list_environments(self):
- envs = self.ansible.get_environments()
- print
- print "Environments"
- print "------------"
- for env in envs:
- print env
- print
-
- def list_security_groups(self):
- envs = self.ansible.get_security_groups()
- print
- print "Groups"
- print "------"
- for env in envs:
- print env
- print
-
-
-if __name__ == '__main__':
- p = Program()