diff options
author | drebs <drebs@riseup.net> | 2017-09-01 08:07:21 -0300 |
---|---|---|
committer | drebs <drebs@riseup.net> | 2017-09-05 11:17:08 -0300 |
commit | 654ec33efae4050f513f6e9d3f1b33c3a39dbedf (patch) | |
tree | 9ca70a036aa7c55b1681e1b36362e99a3b30fa66 /src/leap | |
parent | 90c4c1a8e6df8bf7b6249fa83b50df7c62884d82 (diff) |
[bug] use a different name for each user's blobs db
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/soledad/client/_db/blobs.py | 7 | ||||
-rw-r--r-- | src/leap/soledad/client/api.py | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/leap/soledad/client/_db/blobs.py b/src/leap/soledad/client/_db/blobs.py index 4a3cd913..7015ae5b 100644 --- a/src/leap/soledad/client/_db/blobs.py +++ b/src/leap/soledad/client/_db/blobs.py @@ -175,7 +175,7 @@ class BlobManager(object): cert_file=None): if local_path: mkdir_p(os.path.dirname(local_path)) - self.local = SQLiteBlobBackend(local_path, key) + self.local = SQLiteBlobBackend(local_path, key=key, user=user) self.remote = remote self.secret = secret self.user = user @@ -409,9 +409,10 @@ class BlobManager(object): class SQLiteBlobBackend(object): - def __init__(self, path, key=None): + def __init__(self, path, key=None, user=None): + dbname = '%s_blobs.db' % (user or 'soledad') self.path = os.path.abspath( - os.path.join(path, 'soledad_blob.db')) + os.path.join(path, dbname)) mkdir_p(os.path.dirname(self.path)) if not key: raise ValueError('key cannot be None') diff --git a/src/leap/soledad/client/api.py b/src/leap/soledad/client/api.py index 50f7e5aa..7171761d 100644 --- a/src/leap/soledad/client/api.py +++ b/src/leap/soledad/client/api.py @@ -275,7 +275,7 @@ class Soledad(object): return sync_phase, sync_exchange_phase def _init_blobmanager(self): - path = os.path.join(os.path.dirname(self._local_db_path), 'blobs') + path = os.path.dirname(self._local_db_path) url = urlparse.urljoin(self.server_url, 'blobs/%s' % self.uuid) key = self._secrets.local_key self.blobmanager = blobs.BlobManager( |