diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2016-01-18 14:00:45 +0100 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2016-01-18 14:00:45 +0100 |
commit | 0b06feff629f91d2fa4e7bdbe3b8e46b412e6158 (patch) | |
tree | 67dcbefbddc38a7b48f942196d3b8d7d1aa00bae | |
parent | 6f2ee1d6a7637fae8aaa34c59e507f247e2f5201 (diff) |
Move soledad files to user folder
- Issue #576
-rw-r--r-- | service/pixelated/bitmask_libraries/session.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/service/pixelated/bitmask_libraries/session.py b/service/pixelated/bitmask_libraries/session.py index 45ad1374..dfa96388 100644 --- a/service/pixelated/bitmask_libraries/session.py +++ b/service/pixelated/bitmask_libraries/session.py @@ -153,7 +153,7 @@ class LeapSessionFactory(object): auth = srp_auth.authenticate(username, password) account_email = self._provider.address_for(username) - self._create_database_dir() + self._create_database_dir(auth.uuid) soledad = SoledadFactory.create(auth.token, auth.uuid, @@ -213,20 +213,20 @@ class LeapSessionFactory(object): def _create_nicknym(self, email_address, token, uuid, soledad): return NickNym(self._provider, self._config, soledad, email_address, token, uuid) - def _leap_path(self): - return "%s/soledad" % self._config.leap_home + def _soledad_path(self, user_uuid): + return os.path.join(self._config.leap_home, user_uuid, 'soledad') def _secrets_path(self, user_uuid): - return "%s/%s.secret" % (self._leap_path(), user_uuid) + return os.path.join(self._soledad_path(user_uuid), 'secrets') def _local_db_path(self, user_uuid): - return "%s/%s.db" % (self._leap_path(), user_uuid) + return os.path.join(self._soledad_path(user_uuid), 'soledad.db') - def _create_database_dir(self): + def _create_database_dir(self, user_uuid): try: - os.makedirs(self._leap_path()) + os.makedirs(self._soledad_path(user_uuid)) except OSError as exc: - if exc.errno == errno.EEXIST and os.path.isdir(self._leap_path()): + if exc.errno == errno.EEXIST and os.path.isdir(self._soledad_path(user_uuid)): pass else: raise |