diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-08-06 10:05:45 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-08-06 10:05:45 -0300 |
commit | d6bf9b3e11ff87488a5f508acebf8f20ad026166 (patch) | |
tree | a3de2d064e1bde8d2ae1efc923335d66965943a3 /src/leap/services/soledad | |
parent | e95351d812d98b4be6e1e3dafd6855804d95267a (diff) | |
parent | 4028fc6be007d32209db8657809539d1e110302d (diff) |
Merge remote-tracking branch 'kali/fix/fix_soledad_boostrap' into develop
Conflicts:
src/leap/services/soledad/soledadbootstrapper.py
Diffstat (limited to 'src/leap/services/soledad')
-rw-r--r-- | src/leap/services/soledad/soledadbootstrapper.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/leap/services/soledad/soledadbootstrapper.py b/src/leap/services/soledad/soledadbootstrapper.py index a952fac5..ac3243c1 100644 --- a/src/leap/services/soledad/soledadbootstrapper.py +++ b/src/leap/services/soledad/soledadbootstrapper.py @@ -62,6 +62,7 @@ class SoledadBootstrapper(AbstractBootstrapper): self._download_if_needed = False self._user = "" self._password = "" + self._soledad = None @property def keymanager(self): @@ -89,10 +90,12 @@ class SoledadBootstrapper(AbstractBootstrapper): # TODO: Select server based on timezone (issue #3308) server_dict = self._soledad_config.get_hosts() - if len(server_dict.keys() > 0): + if server_dict.keys(): selected_server = server_dict[server_dict.keys()[0]] server_url = "https://%s:%s/user-%s" % ( - selected_server["hostname"], selected_server["port"], uuid) + selected_server["hostname"], + selected_server["port"], + uuid) logger.debug("Using soledad server url: %s" % (server_url,)) @@ -126,12 +129,12 @@ class SoledadBootstrapper(AbstractBootstrapper): self._soledad_config = SoledadConfig() headers = {} - mtime = get_mtime(os.path.join(self._soledad_config - .get_path_prefix(), - "leap", - "providers", - self._provider_config.get_domain(), - "soledad-service.json")) + mtime = get_mtime( + os.path.join( + self._soledad_config.get_path_prefix(), + "leap", "providers", + self._provider_config.get_domain(), + "soledad-service.json")) if self._download_if_needed and mtime: headers['if-modified-since'] = mtime @@ -159,9 +162,10 @@ class SoledadBootstrapper(AbstractBootstrapper): if res.status_code == 304: logger.debug("Soledad definition has not been modified") self._soledad_config.load( - os.path.join("leap", "providers", - self._provider_config.get_domain(), - "soledad-service.json")) + os.path.join( + "leap", "providers", + self._provider_config.get_domain(), + "soledad-service.json")) else: soledad_definition, mtime = get_content(res) @@ -190,7 +194,7 @@ class SoledadBootstrapper(AbstractBootstrapper): address, "https://nicknym.%s:6425" % (self._provider_config.get_domain(),), self._soledad, - #token=srp_auth.get_token(), # TODO: enable token usage + #token=srp_auth.get_token(), # TODO: enable token usage session_id=srp_auth.get_session_id(), ca_cert_path=self._provider_config.get_ca_cert_path(), api_uri=self._provider_config.get_api_uri(), |