diff options
author | Jorik Schellekens <joriks@matrix.org> | 2019-08-23 11:18:41 +0100 |
---|---|---|
committer | Jorik Schellekens <joriks@matrix.org> | 2019-08-23 11:18:41 +0100 |
commit | c2247b3c2879bcec9489e5049fd64f28d5a1ef28 (patch) | |
tree | cea9b19a0bafb038c96ef661f15c8c65afc829fd | |
parent | Propagate opentracing contexts through EDUs (#5852) (diff) | |
download | synapse-c2247b3c2879bcec9489e5049fd64f28d5a1ef28.tar.xz |
Let synctl use a config directory.
-rw-r--r-- | synapse/config/__init__.py | 2 | ||||
-rwxr-xr-x | synctl | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/synapse/config/__init__.py b/synapse/config/__init__.py index f2a5a41e92..c5ff51f4af 100644 --- a/synapse/config/__init__.py +++ b/synapse/config/__init__.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ._base import ConfigError +from ._base import ConfigError, find_config_files, read_config_files # export ConfigError if somebody does import * # this is largely a fudge to stop PEP8 moaning about the import diff --git a/synctl b/synctl index 794de99ea3..83474eedc6 100755 --- a/synctl +++ b/synctl @@ -30,6 +30,8 @@ from six import iteritems import yaml +from synapse.config import find_config_files, read_config_files + SYNAPSE = [sys.executable, "-B", "-m", "synapse.app.homeserver"] GREEN = "\x1b[1;32m" @@ -135,7 +137,8 @@ def main(): "configfile", nargs="?", default="homeserver.yaml", - help="the homeserver config file, defaults to homeserver.yaml", + help="the homeserver config file, defaults to homeserver.yaml, may also specify" + " a directory with *.yaml files", ) parser.add_argument( "-w", "--worker", metavar="WORKERCONFIG", help="start or stop a single worker" @@ -176,8 +179,7 @@ def main(): ) sys.exit(1) - with open(configfile) as stream: - config = yaml.safe_load(stream) + config = read_config_files(find_config_files([configfile])) pidfile = config["pid_file"] cache_factor = config.get("synctl_cache_factor") |