Load arbitrary .py config files from a conf.d dir

We want to keep the amount of custom code we support extremely
small. This provides a nice escape hatch for everything else.
This commit is contained in:
yuvipanda
2018-07-30 22:35:55 -07:00
parent 02695e4687
commit 3124cf1f80

View File

@@ -3,8 +3,8 @@ JupyterHub config for the littlest jupyterhub.
""" """
import copy import copy
import os import os
import yaml import yaml
from glob import glob
from systemdspawner import SystemdSpawner from systemdspawner import SystemdSpawner
from tljh import user, configurer from tljh import user, configurer
@@ -47,3 +47,9 @@ if os.path.exists(config_overrides_path):
else: else:
config_overrides = {} config_overrides = {}
configurer.apply_config(config_overrides, c) configurer.apply_config(config_overrides, c)
# Load arbitrary .py config files if they exist.
# This is our escape hatch
extra_configs = sorted(glob(os.path.join(INSTALL_PREFIX, 'config.d', '*.py')))
for ec in extra_configs:
load_subconfig(ec)