diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2016-09-29 12:24:49 -0400 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-09-29 12:25:06 -0400 |
commit | 372b6cfc13494b95028d4ec531b842685ecf370a (patch) | |
tree | 25011f0953d9f7262b7bd0c7d16e91d58cd74fdf /src/leap/bitmask/keymanager | |
parent | 2fc85ad7d109ca4304d1fb1515b7087a1bb2ae3e (diff) |
[bug] remove destructor, pass combined_ca_bundle as optional param
this brings back a couple of commits by pixelated that were missed in my
keymanager merge.
https://github.com/leapcode/keymanager/commit/354ad5a12e90463f9952fe056f191c6d4cdadf40
https://github.com/leapcode/keymanager/commit/dd7ba606df2909c76b20b1d4bb0134302f94b3d0
basically it removes the destructor (there's no guarantee that it gets
executed!) and it addds the combined ca bundle as an optional parameter
to keymanager initialization
Diffstat (limited to 'src/leap/bitmask/keymanager')
-rw-r--r-- | src/leap/bitmask/keymanager/__init__.py | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/leap/bitmask/keymanager/__init__.py b/src/leap/bitmask/keymanager/__init__.py index c3ece05..146bcd2 100644 --- a/src/leap/bitmask/keymanager/__init__.py +++ b/src/leap/bitmask/keymanager/__init__.py @@ -65,7 +65,7 @@ class KeyManager(object): def __init__(self, address, nickserver_uri, soledad, token=None, ca_cert_path=None, api_uri=None, api_version=None, uid=None, - gpgbinary=None): + gpgbinary=None, combined_ca_bundle=None): """ Initialize a Key Manager for user's C{address} with provider's nickserver reachable in C{nickserver_uri}. @@ -98,24 +98,11 @@ class KeyManager(object): self.api_version = api_version self.uid = uid self._openpgp = OpenPGPScheme(soledad, gpgbinary=gpgbinary) - self._combined_ca_bundle = self._create_combined_bundle_file() + self._combined_ca_bundle = combined_ca_bundle or self._create_combined_bundle_file() self._async_client = HTTPClient(self._combined_ca_bundle) self._async_client_pinned = HTTPClient(self._ca_cert_path) # - # destructor - # - - def __del__(self): - try: - created_tmp_combined_ca_bundle = self._combined_ca_bundle not in \ - [ca_bundle.where(), self._ca_cert_path] - if created_tmp_combined_ca_bundle: - os.remove(self._combined_ca_bundle) - except OSError: - pass - - # # utilities # |