summaryrefslogtreecommitdiff
path: root/src/leap/soledad/__init__.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-04-30 17:52:19 -0300
committerdrebs <drebs@leap.se>2013-04-30 17:52:19 -0300
commit77c8c16a5de20d8d8ac6cf3b50eda666abfad077 (patch)
tree7c67a70ad8d1a149bbf630ed5912cb3ede5df326 /src/leap/soledad/__init__.py
parent516a5adb4f8328bd94446f4ea7ad0bc9298d7bfb (diff)
Make soledad's init arguments mandatory.
Diffstat (limited to 'src/leap/soledad/__init__.py')
-rw-r--r--src/leap/soledad/__init__.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py
index 7d2663e8..9e920d68 100644
--- a/src/leap/soledad/__init__.py
+++ b/src/leap/soledad/__init__.py
@@ -77,12 +77,6 @@ class NotADirectory(Exception):
"""
-class NoServerUrl(Exception):
- """
- Tried to get access to shared recovery database but there's no URL for it.
- """
-
-
#
# Soledad: local encrypted storage and remote encrypted sync.
#
@@ -138,9 +132,8 @@ class Soledad(object):
Prefix for default values for path.
"""
- def __init__(self, uuid, passphrase, secret_path=None,
- local_db_path=None, server_url=None, auth_token=None,
- bootstrap=True):
+ def __init__(self, uuid, passphrase, secret_path, local_db_path,
+ server_url, auth_token=None, bootstrap=True):
"""
Initialize configuration, cryptographic keys and dbs.
@@ -167,8 +160,8 @@ class Soledad(object):
# TODO: allow for fingerprint enforcing.
self._uuid = uuid
self._passphrase = passphrase
- self._set_token(auth_token)
self._init_config(secret_path, local_db_path, server_url)
+ self._set_token(auth_token)
if bootstrap:
self._bootstrap()
@@ -188,8 +181,9 @@ class Soledad(object):
self.DEFAULT_PREFIX, 'soledad.u1db')
# initialize server_url
self._server_url = server_url
- if self._server_url is None:
- raise NoServerUrl()
+ leap_assert(
+ self._server_url is not None,
+ 'Missing URL for Soledad server.')
#
# initialization/destruction methods