summaryrefslogtreecommitdiff
path: root/server/src/leap/soledad
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/leap/soledad')
-rw-r--r--server/src/leap/soledad/server/_blobs.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/server/src/leap/soledad/server/_blobs.py b/server/src/leap/soledad/server/_blobs.py
index 4b0cd0de..c9b78005 100644
--- a/server/src/leap/soledad/server/_blobs.py
+++ b/server/src/leap/soledad/server/_blobs.py
@@ -120,7 +120,10 @@ class FilesystemBlobsBackend(object):
def write_blob(self, user, blob_id, request):
path = self._get_path(user, blob_id)
- logger.info('writing blob: %s - %s' % (user, blob_id))
+ try:
+ os.makedirs(os.path.split(path)[0])
+ except:
+ pass
if os.path.isfile(path):
# XXX return some 5xx code
raise BlobAlreadyExists()
@@ -131,11 +134,7 @@ class FilesystemBlobsBackend(object):
request.write('Quota Exceeded!')
request.finish()
return NOT_DONE_YET
- try:
- os.makedirs(os.path.split(path)[0])
- except:
- pass
- logger.debug("writing blob: %s" % path)
+ logger.info('writing blob: %s - %s' % (user, blob_id))
fbp = FileBodyProducer(request.content)
d = fbp.startProducing(open(path, 'wb'))
d.addCallback(lambda _: request.finish())