Last active
August 29, 2015 14:25
-
-
Save vadim8kiselev/6cfce25b350c91c4b77d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Command manager for gigaspace service | |
""" | |
import sys | |
import argparse | |
sys.path.append('/isodenv/scripts') | |
from deployer_lib import * | |
parser = argparse.ArgumentParser() | |
subparsers = parser.add_subparsers(dest='unit') | |
all_subparsers = [ 'start', 'stop', 'status', \ | |
'start-gs', 'kill-gs', 'health-check', \ | |
'start-ui', 'kill-ui', 'redeploy-app'] | |
for subp in all_subparsers: | |
subparsers.add_parser(subp) | |
command = parser.parse_args(sys.argv[1:]) | |
command_list = {'start' : init, 'stop' : stop, 'status' : status, \ | |
'start-gs' : start_gs, 'kill-gs' : kill_gs, 'health-check' : health_check, \ | |
'start-ui' : start_ui, 'kill-ui' : kill_ui, 'redeploy-app' : redeploy_app} | |
if command.unit in all_subparsers: | |
command_list[command.unit]() | |
else: | |
print 'wrong command' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Approved.