forked from yunionio/ocboot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ocboot.py
executable file
·40 lines (34 loc) · 1.06 KB
/
ocboot.py
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
#!/usr/bin/env python3
import sys
import argparse
from lib import install, upgrade
from lib import backup, restore
from lib import add_node
from lib import add_lbagent
from lib import stop, start
from lib import ce, ee
from lib import auto_backup
def main():
parser = argparse.ArgumentParser(prog='ocboot.py')
subparsers = parser.add_subparsers(dest="subcmd",
title="sub commands",
help='sub-command help')
add_lbagent.add_command(subparsers)
add_node.add_command(subparsers)
auto_backup.add_command(subparsers)
backup.add_command(subparsers)
ce.add_command(subparsers)
ee.add_command(subparsers)
install.add_command(subparsers)
restore.add_command(subparsers)
start.add_command(subparsers)
start.add_command(subparsers)
stop.add_command(subparsers)
upgrade.add_command(subparsers)
args = parser.parse_args()
if not args.subcmd:
parser.print_help()
else:
args.func(args)
if __name__ == "__main__":
sys.exit(main())