-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathconfigure_ssl.py
44 lines (32 loc) · 1.2 KB
/
configure_ssl.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
42
43
44
# grown-up modules
import json
import logging
import os
from cryptography import x509
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import dh, rsa
from cryptography.x509.oid import NameOID
# local modules
from irods_testing_environment.ssl_setup import configure_ssl_in_zone
from irods_testing_environment import logs
from irods_testing_environment import context
from irods_testing_environment import execute
from irods_testing_environment import json_utils
if __name__ == "__main__":
import argparse
import compose.cli.command
import docker
import cli
parser = argparse.ArgumentParser(description='Configure SSL in a running iRODS Zone.')
cli.add_common_args(parser)
cli.add_compose_args(parser)
args = parser.parse_args()
docker_client = docker.from_env()
compose_project = compose.cli.command.get_project(os.path.abspath(args.project_directory),
project_name=args.project_name)
logs.configure(args.verbosity)
try:
configure_ssl_in_zone(docker_client, compose_project)
except Exception as e:
logging.critical(e)
exit(1)