-
Notifications
You must be signed in to change notification settings - Fork 0
/
secrets-cli
executable file
·39 lines (29 loc) · 1.07 KB
/
secrets-cli
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
#!/usr/bin/env python3
import argparse
from secretservice.logger import *
from secretservice.main import *
def parse_args():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("-v", "--verbosity",
help="logging verbosity",
type=LogLevel.__getitem__,
choices=list(LogLevel),
default=LogLevel.info)
parser.add_argument("-p", "--profile",
help="AWS Profile",
default=None)
return parser.parse_args()
def main():
mainLogger, args = handle_arguments(parse_args())
secret_service = SecretService(mainLogger)
secret_service.benchmark()
mainLogger.info("Hello World!")
def handle_arguments(args):
mainLogger = setup_logger('MAIN', args.verbosity)
if args.profile:
mainLogger.debug("Setting profile to {}".format(args.profile))
set_aws_profile(profile=args.profile)
return mainLogger, args
if __name__ == '__main__':
main()