diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-05-11 17:51:46 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-05-11 17:51:46 -0400 |
commit | 0c490dfee3604816dcceb628d2b7b263a744f7a9 (patch) | |
tree | 4d411d75d008ab0b5d92e2afaa093228e307a26e | |
parent | f23c1474ffc7ae9d71d1f43e19d0cf902eeaa2b5 (diff) | |
download | b4-0c490dfee3604816dcceb628d2b7b263a744f7a9.tar.gz |
Clean up after ourselves
Remember to remove the temporary mbox if we're done with it.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/mbox.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -541,7 +541,8 @@ def main(cmdargs): try: import patatt except ModuleNotFoundError: - logger.info('--show-keys requires patatt library') + logger.info('--show-keys requires the patatt library') + os.unlink(threadfile) sys.exit(1) keydata = set() @@ -564,8 +565,11 @@ def main(cmdargs): logger.debug('Unknown key type: %s', algo) continue keydata.add((identity, algo, selector, keyinfo)) + mbx.close() + if not keydata: logger.info('No keys found in the thread.') + os.unlink(threadfile) sys.exit(0) krpath = os.path.join(b4.get_data_dir(), 'keyring') pgp = False @@ -605,6 +609,8 @@ def main(cmdargs): if ecc: logger.info('For ed25519 keys:') logger.info(' echo [pubkey] > [fullpath]') + + os.unlink(threadfile) sys.exit(0) logger.info('%s messages in the thread', len(mbx)) |