mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-08 14:22:56 +00:00
Reformat everything with black.
I had to undo the u string prefix removals to not drop Python 2 compatibility. That's why black isn't enabled in antsibull-nox.toml yet.
This commit is contained in:
@@ -22,9 +22,9 @@ class PluginGPGRunner(GPGRunner):
|
||||
def __init__(self, executable=None, cwd=None):
|
||||
if executable is None:
|
||||
try:
|
||||
executable = get_bin_path('gpg')
|
||||
executable = get_bin_path("gpg")
|
||||
except ValueError:
|
||||
raise GPGError('Cannot find the `gpg` executable on the controller')
|
||||
raise GPGError("Cannot find the `gpg` executable on the controller")
|
||||
self.executable = executable
|
||||
self.cwd = cwd
|
||||
|
||||
@@ -41,15 +41,19 @@ class PluginGPGRunner(GPGRunner):
|
||||
Raises a ``GPGError`` in case of errors.
|
||||
"""
|
||||
command = [self.executable] + command
|
||||
p = Popen(command, shell=False, cwd=self.cwd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
||||
p = Popen(
|
||||
command, shell=False, cwd=self.cwd, stdin=PIPE, stdout=PIPE, stderr=PIPE
|
||||
)
|
||||
stdout, stderr = p.communicate(input=data)
|
||||
stdout = to_native(stdout, errors='surrogate_or_replace')
|
||||
stderr = to_native(stderr, errors='surrogate_or_replace')
|
||||
stdout = to_native(stdout, errors="surrogate_or_replace")
|
||||
stderr = to_native(stderr, errors="surrogate_or_replace")
|
||||
if check_rc and p.returncode != 0:
|
||||
raise GPGError('Running {cmd} yielded return code {rc} with stdout: "{stdout}" and stderr: "{stderr}")'.format(
|
||||
cmd=' '.join(command),
|
||||
rc=p.returncode,
|
||||
stdout=to_native(stdout, errors='surrogate_or_replace'),
|
||||
stderr=to_native(stderr, errors='surrogate_or_replace'),
|
||||
))
|
||||
raise GPGError(
|
||||
'Running {cmd} yielded return code {rc} with stdout: "{stdout}" and stderr: "{stderr}")'.format(
|
||||
cmd=" ".join(command),
|
||||
rc=p.returncode,
|
||||
stdout=to_native(stdout, errors="surrogate_or_replace"),
|
||||
stderr=to_native(stderr, errors="surrogate_or_replace"),
|
||||
)
|
||||
)
|
||||
return p.returncode, stdout, stderr
|
||||
|
||||
Reference in New Issue
Block a user