summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorMichael Kaye <1917473+michaelkaye@users.noreply.github.com>2018-06-22 16:54:59 +0100
committerMichael Kaye <1917473+michaelkaye@users.noreply.github.com>2018-06-22 16:54:59 +0100
commitc18011621541e6487cadfb158a9999ab268c902f (patch)
tree593f1fb20c3a9f46f7d9d564474969d8daa21879 /synapse
parentMerge branch 'master' into develop (diff)
downloadsynapse-michaelkaye/synapse_config_check.tar.xz
Diffstat (limited to 'synapse')
-rw-r--r--synapse/config/_base.py11
1 files changed, 10 insertions, 1 deletions
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
@@ -224,6 +224,11 @@ class Config(object):
             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",
             help="Whether the generated config reports anonymized usage statistics",
@@ -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