-
Notifications
You must be signed in to change notification settings - Fork 48
/
run.py
36 lines (28 loc) · 1.08 KB
/
run.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
import argparse
from alembic.config import main as alembic_main
from fence import app, app_init, config
parser = argparse.ArgumentParser()
parser.add_argument(
"-c",
"--config_file_name",
help="Name for file is something other than "
"fence-config.yaml. Will search in defined search folders specified in "
"fence's settings. To automatically create configs, check out the "
'cfg_help.py file in this directory. Run "python cfg_help.py --help".',
default="fence-config.yaml",
)
parser.add_argument(
"--config_path",
help="Full path to a yaml config file for fence. Will not"
" search directories for config.",
)
args = parser.parse_args()
if config.get("MOCK_STORAGE"):
from mock import patch
from tests.storageclient.storage_client_mock import get_client
patcher = patch("fence.resources.storage.get_client", get_client)
patcher.start()
if config.get("ENABLE_DB_MIGRATION"):
alembic_main(["--raiseerr", "upgrade", "head"])
app_init(app, config_path=args.config_path, config_file_name=args.config_file_name)
app.run(debug=True, port=8000)