summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTulio Casagrande <tcasagra@thoughtworks.com>2016-08-30 11:49:39 -0300
committerTulio Casagrande <tcasagra@thoughtworks.com>2016-08-30 16:23:14 -0300
commitf92cfcdfc943cfc01d1dca255cecd70723c4b1f1 (patch)
treec9e3b0d6fd65ec907dfea8ea0c9f069082a1bd14
parentdd7ba606df2909c76b20b1d4bb0134302f94b3d0 (diff)
[bug] don't remove combined_bundle file on destructor
After PR #116, it's possible to inject an existing combined_ca_bundle to the keymanager initialisation. However, it won't work for multiple users because the file is removed when the keymanager is destroyed. Considering there's no sensitive data on the file and it's created as a temp file, we don't need to handle its deletion.
-rw-r--r--src/leap/keymanager/__init__.py13
-rw-r--r--tests/test_keymanager.py4
2 files changed, 0 insertions, 17 deletions
diff --git a/src/leap/keymanager/__init__.py b/src/leap/keymanager/__init__.py
index ac9f8eb..2a5bac4 100644
--- a/src/leap/keymanager/__init__.py
+++ b/src/leap/keymanager/__init__.py
@@ -131,19 +131,6 @@ class KeyManager(object):
self.refresher = None
#
- # 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
#
diff --git a/tests/test_keymanager.py b/tests/test_keymanager.py
index 118cd8c..ae06372 100644
--- a/tests/test_keymanager.py
+++ b/tests/test_keymanager.py
@@ -20,7 +20,6 @@
Tests for the Key Manager.
"""
-from os import path
import json
import urllib
from datetime import datetime
@@ -496,9 +495,6 @@ class KeyManagerKeyManagementTestCase(KeyManagerWithSoledadTestCase):
expected = self._slurp_file(ca_bundle.where()) + ca_content
self.assertEqual(expected, self._slurp_file(tmp_output.name))
- del km # force km out of scope
- self.assertFalse(path.exists(tmp_output.name))
-
def _dump_to_file(self, filename, content):
with open(filename, 'w') as out:
out.write(content)