summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-05-16 22:07:25 +0200
committerMichał Górny <mgorny@gentoo.org>2020-05-16 22:07:25 +0200
commitdb0f279de590f2457f939060e83e9ef0dff38647 (patch)
tree49aa50f5ba9dcf3362499939843a7eedb096aefd
parent55a9a2f01baed17eb4b6eff88b0f8a1343a847d4 (diff)
downloadgemato-db0f279de590f2457f939060e83e9ef0dff38647.tar.gz
openpgp: Fix killing gpg-agent
Fix missing argument to 'gpgconf --kill', run it independently of debug and report a warning if it fails. Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--gemato/openpgp.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gemato/openpgp.py b/gemato/openpgp.py
index 010c750..285a783 100644
--- a/gemato/openpgp.py
+++ b/gemato/openpgp.py
@@ -234,8 +234,12 @@ debug-level guru
def close(self):
if self._home is not None:
+ ret, sout, serr = self._spawn_gpg(
+ ['gpgconf', '--kill', 'all'])
+ if ret != 0:
+ logging.warning('gpgconf --kill failed: {}'
+ .format(serr))
if not self.debug:
- self._spawn_gpg(['gpgconf', '--kill'])
# we need to loop due to ENOTEMPTY potential
while os.path.isdir(self._home):
shutil.rmtree(self._home,