summaryrefslogtreecommitdiff
path: root/src/leap/soledad/__init__.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-05-03 17:20:34 -0300
committerdrebs <drebs@leap.se>2013-05-03 17:20:34 -0300
commit54e463be00de78a336f4e547634a77faf6a60b37 (patch)
treeb1645b01f824118a0fdf42195f756ac1f9870770 /src/leap/soledad/__init__.py
parenta66c472b09015c4310519bc71eeef925d9041de6 (diff)
Use mkdir_p from leap.common.
Diffstat (limited to 'src/leap/soledad/__init__.py')
-rw-r--r--src/leap/soledad/__init__.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py
index 2138e14e..b87dbbb6 100644
--- a/src/leap/soledad/__init__.py
+++ b/src/leap/soledad/__init__.py
@@ -42,6 +42,7 @@ from hashlib import sha256
from leap.common import events
from leap.common.check import leap_assert
+from leap.common.files import mkdir_p
from leap.soledad.backends import sqlcipher
from leap.soledad.backends.leap_backend import (
LeapDocument,
@@ -254,19 +255,15 @@ class Soledad(object):
def _init_dirs(self):
"""
Create work directories.
+
+ @raise OSError: in case file exists and is not a dir.
"""
paths = map(
lambda x: os.path.dirname(x),
[self.local_db_path, self.secret_path])
for path in paths:
- if not os.path.isfile(path):
- if not os.path.isdir(path):
- logger.info('Creating directory: %s.' % path)
- os.makedirs(path)
- else:
- logger.info('Using existent directory: %s.' % path)
- else:
- raise NotADirectory(path)
+ logger.info('Creating directory: %s.' % path)
+ mkdir_p(path)
def _init_keys(self):
"""