diff options
author | Ruben Pollan <meskio@sindominio.net> | 2016-09-20 16:45:53 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2016-09-20 18:53:19 +0200 |
commit | 607df76ebdf5516085835a0a1f7718baf966a6e0 (patch) | |
tree | eea518e4f699f58600833971dafa77a3eb4bd42a /src/leap/bitmask/mail | |
parent | eebfd5ea79348b19fdd0c3010735580991c3cdd1 (diff) |
[feat] discover gpg bin path instead of hardcode it
Diffstat (limited to 'src/leap/bitmask/mail')
-rw-r--r-- | src/leap/bitmask/mail/imap/service/imap-server.tac | 3 | ||||
-rw-r--r-- | src/leap/bitmask/mail/testing/__init__.py | 10 |
2 files changed, 4 insertions, 9 deletions
diff --git a/src/leap/bitmask/mail/imap/service/imap-server.tac b/src/leap/bitmask/mail/imap/service/imap-server.tac index 685db6b..e695630 100644 --- a/src/leap/bitmask/mail/imap/service/imap-server.tac +++ b/src/leap/bitmask/mail/imap/service/imap-server.tac @@ -36,6 +36,7 @@ import sys from twisted.application import service, internet +from leap.bitmask.util import get_gpg_bin_path from leap.bitmask.keymanager import KeyManager from leap.bitmask.mail.imap.service import imap from leap.soledad.client import Soledad @@ -123,7 +124,7 @@ km_kwargs = { "api_uri": "", "api_version": "", "uid": uuid, - "gpgbinary": "/usr/bin/gpg" + "gpgbinary": get_gpg_bin_path() } keymanager = KeyManager(*km_args, **km_kwargs) diff --git a/src/leap/bitmask/mail/testing/__init__.py b/src/leap/bitmask/mail/testing/__init__.py index b5a2a42..5ebfaf5 100644 --- a/src/leap/bitmask/mail/testing/__init__.py +++ b/src/leap/bitmask/mail/testing/__init__.py @@ -25,6 +25,7 @@ from twisted.trial import unittest from twisted.internet import defer from leap.common.testing.basetest import BaseLeapTest +from leap.bitmask.util import get_gpg_bin_path from leap.bitmask.keymanager import KeyManager from leap.soledad.client import Soledad @@ -46,7 +47,7 @@ class defaultMockSharedDB(object): class KeyManagerWithSoledadTestCase(unittest.TestCase, BaseLeapTest): def setUp(self): - self.gpg_binary_path = self._find_gpg() + self.gpg_binary_path = get_gpg_bin_path() self._soledad = Soledad( u"leap@leap.se", @@ -110,13 +111,6 @@ class KeyManagerWithSoledadTestCase(unittest.TestCase, BaseLeapTest): gpgbinary=self.gpg_binary_path, ca_cert_path=ca_cert_path) - def _find_gpg(self): - gpg_path = distutils.spawn.find_executable('gpg') - if gpg_path is not None: - return os.path.realpath(gpg_path) - else: - return "/usr/bin/gpg" - def get_public_binary_key(self): with open(PATH + '/fixtures/public_key.bin', 'r') as binary_public_key: return binary_public_key.read() |