-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
41 lines (32 loc) · 950 Bytes
/
main.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
41
import argparse
import sys
from commands.configuration import Configuration
from commands.docker import DockerBuilder
from commands.gravitee import GraviteeBuilder
from commands.keycloak import KeyCloakBuilder
# === Script Commands ===
COMMANDS = {
'configuration': Configuration,
'docker': DockerBuilder,
'keycloak': KeyCloakBuilder,
'gravitee': GraviteeBuilder
}
def get_args():
"""
Argument parser to manage the AAA module
"""
parser = argparse.ArgumentParser(
description='Script to manage 5G City AAA')
subparser = parser.add_subparsers(dest="command")
for key, value in COMMANDS.items():
_parser = subparser.add_parser(key)
value.build_parser(_parser)
args = parser.parse_args()
command = args.command
del args.command
try:
COMMANDS[command].execute(args)
except KeyboardInterrupt:
sys.exit()
if __name__ == '__main__':
get_args()