From 8abc5d01b600a32c4612907894c7cc59ae10a1b2 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 29 Apr 2013 17:06:27 -0300 Subject: Cleanup _gen_symkey error raising. --- src/leap/soledad/__init__.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/leap/soledad') diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py index 96b05628..5b2f5fc1 100644 --- a/src/leap/soledad/__init__.py +++ b/src/leap/soledad/__init__.py @@ -324,15 +324,11 @@ class Soledad(object): if not self._has_symkey(): raise KeyDoesNotExist("Tried to load key for symmetric " "encryption but it does not exist on disk.") - try: - with open(self._config.get_secret_path()) as f: - self._symkey = \ - self._crypto.decrypt_sym( - f.read(), passphrase=self._passphrase) - self._crypto.symkey = self._symkey - except IOError: - raise IOError('Failed to open secret file %s.' % - self._config.get_secret_path()) + with open(self._config.get_secret_path()) as f: + self._symkey = \ + self._crypto.decrypt_sym( + f.read(), passphrase=self._passphrase) + self._crypto.symkey = self._symkey def _gen_symkey(self): """ -- cgit v1.2.3