From 6afe20350ba698c6bb0d8959e8361d95042ab7c5 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sun, 1 Jul 2018 12:12:16 +0300 Subject: [PATCH] Simplify GPG command generation --- libagent/gpg/keyring.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libagent/gpg/keyring.py b/libagent/gpg/keyring.py index 9be99bf..d191fb6 100644 --- a/libagent/gpg/keyring.py +++ b/libagent/gpg/keyring.py @@ -201,16 +201,16 @@ def get_gnupg_components(sp=subprocess): def get_gnupg_binary(sp=subprocess, neopg_binary=None): """Starting GnuPG 2.2.x, the default installation uses `gpg`.""" if neopg_binary: - return [neopg_binary] - return [get_gnupg_components(sp=sp)['gpg']] + return neopg_binary + return get_gnupg_components(sp=sp)['gpg'] def gpg_command(args, env=None): """Prepare common GPG command line arguments.""" if env is None: env = os.environ - cmd = get_gnupg_binary(neopg_binary=env.get('NEOPG_BINARY')).copy() - return cmd + args + cmd = get_gnupg_binary(neopg_binary=env.get('NEOPG_BINARY')) + return [cmd] + args def get_keygrip(user_id, sp=subprocess):