diff options
author | Steven Hammerton <steven.hammerton@openmarket.com> | 2015-11-17 10:55:41 +0000 |
---|---|---|
committer | Steven Hammerton <steven.hammerton@openmarket.com> | 2015-11-17 10:55:41 +0000 |
commit | f5e25c5f358de93f8bbba83496a44cf217ce086a (patch) | |
tree | c01c8462aa3a004e103de4befc45b7f9206439b1 /synapse/config | |
parent | Snakes not camels (diff) | |
parent | Merge pull request #376 from matrix-org/daniel/jenkins (diff) | |
download | synapse-f5e25c5f358de93f8bbba83496a44cf217ce086a.tar.xz |
Merge branch 'develop' into sh-cas-auth-via-homeserver
Diffstat (limited to 'synapse/config')
-rw-r--r-- | synapse/config/_base.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/config/_base.py b/synapse/config/_base.py index ceef309afc..c18e0bdbb8 100644 --- a/synapse/config/_base.py +++ b/synapse/config/_base.py @@ -14,6 +14,7 @@ # limitations under the License. import argparse +import errno import os import yaml import sys @@ -91,8 +92,11 @@ class Config(object): @classmethod def ensure_directory(cls, dir_path): dir_path = cls.abspath(dir_path) - if not os.path.exists(dir_path): + try: os.makedirs(dir_path) + except OSError, e: + if e.errno != errno.EEXIST: + raise if not os.path.isdir(dir_path): raise ConfigError( "%s is not a directory" % (dir_path,) |