Verified Commit f8c18e69 authored by Baptiste Beauplat's avatar Baptiste Beauplat
Browse files

Make args from GnuPG._run() mandatory

Since the default arguments have no action, an optional args doesn't
make sense.
parent c9f16579
...@@ -110,7 +110,7 @@ class GnuPG(): ...@@ -110,7 +110,7 @@ class GnuPG():
""" """
try: try:
(output, status) = self._run(args=['--list-keys']) (output, status) = self._run(['--list-keys'])
keys = KeyData.read_from_gpg(output.splitlines()) keys = KeyData.read_from_gpg(output.splitlines())
return list(keys.values()) return list(keys.values())
...@@ -126,8 +126,8 @@ class GnuPG(): ...@@ -126,8 +126,8 @@ class GnuPG():
``signed_file`` ``signed_file``
path to signed file path to signed file
""" """
args = ('--verify', signed_file) args = ['--verify', signed_file]
(output, status) = self._run(args=args) (output, status) = self._run(args)
output = output.splitlines() output = output.splitlines()
err_sig_re = re.compile(r'\[GNUPG:\] ERRSIG (?P<long_id>\w+)' err_sig_re = re.compile(r'\[GNUPG:\] ERRSIG (?P<long_id>\w+)'
...@@ -172,7 +172,7 @@ class GnuPG(): ...@@ -172,7 +172,7 @@ class GnuPG():
""" """
args = ['--import-options', 'import-minimal', '--import'] args = ['--import-options', 'import-minimal', '--import']
(output, status) = self._run(args=args, stdin=data) (output, status) = self._run(args, stdin=data)
if status and output and len(output.splitlines()) > 0: if status and output and len(output.splitlines()) > 0:
raise ExceptionGnuPG(_('Cannot add key:' raise ExceptionGnuPG(_('Cannot add key:'
...@@ -180,7 +180,7 @@ class GnuPG(): ...@@ -180,7 +180,7 @@ class GnuPG():
return (output, status) return (output, status)
def _run(self, stdin=None, args=None): def _run(self, args, stdin=None):
""" """
Run gpg with the given stdin and arguments and return the output and Run gpg with the given stdin and arguments and return the output and
exit status. exit status.
...@@ -214,10 +214,7 @@ class GnuPG(): ...@@ -214,10 +214,7 @@ class GnuPG():
'--trust-model', 'always', '--trust-model', 'always',
'--with-colons', '--with-colons',
'--with-fingerprint' '--with-fingerprint'
] ] + args
if args is not None:
cmd.extend(args)
try: try:
output = debexpo_exec(self.gpg_path, cmd, env=env, output = debexpo_exec(self.gpg_path, cmd, env=env,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment