From c18011621541e6487cadfb158a9999ab268c902f Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Fri, 22 Jun 2018 16:54:59 +0100 Subject: WIP of --config-check commandline flag --- synapse/config/_base.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'synapse/config/_base.py') diff --git a/synapse/config/_base.py b/synapse/config/_base.py index b748ed2b0a..66034a386c 100644 --- a/synapse/config/_base.py +++ b/synapse/config/_base.py @@ -223,6 +223,11 @@ class Config(object): action="store_true", help="Generate a config file for the server name" ) + config_parser.add_argument( + "--check-config", + action="store_true", + help="Check configuration supplied is valid" + ) config_parser.add_argument( "--report-stats", action="store", @@ -250,6 +255,8 @@ class Config(object): config_files = find_config_files(search_paths=config_args.config_path) generate_keys = config_args.generate_keys + + check_config = config_args.check_config obj = cls() @@ -333,7 +340,9 @@ class Config(object): if generate_keys: return None - obj.invoke_all("read_arguments", args) + obj.invoke_all("read_arguments", args) + if check_config: + return None return obj -- cgit 1.5.1