diff options
author | Erik Johnston <erik@matrix.org> | 2015-11-13 11:40:17 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-11-13 11:40:17 +0000 |
commit | da3dd4867dfb6414a4402089cbe3ef70fb605d23 (patch) | |
tree | a80ccd094d9dacafdbe02dc4a6705b0f3d217c2b /synapse/config/_base.py | |
parent | Update date (diff) | |
parent | Implementation of state rollback in /sync (diff) | |
download | synapse-da3dd4867dfb6414a4402089cbe3ef70fb605d23.tar.xz |
Merge branch 'develop' into release-v0.11.0
Diffstat (limited to 'synapse/config/_base.py')
-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,) |