blob: 98bf87e430cc7e0280d93b5f5f54f219c7fd121d [file] [log] [blame]
Mohammed Naserd531f362022-09-16 11:38:55 -04001import os
2import sys
3
4import confspirator
5from confspirator import groups
6
7from atmosphere.config import images, memcached
8
9_root_config = groups.ConfigGroup("atmosphere")
10_root_config.register_child_config(images.config_group)
11_root_config.register_child_config(memcached.config_group)
12
13CONFIG_FILE = os.environ.get('ATMOSPHERE_CONFIG', '/etc/atmosphere/config.toml')
14
15
16def _load_config():
17 if "pytest" in sys.modules:
18 return confspirator.load_dict(_root_config, {}, test_mode=True)
19
20 return confspirator.load_file(_root_config, CONFIG_FILE)
21
22
23CONF = _load_config()