Skip to content

Commit

Permalink
pkg_integrity: return GPGCli() instances where appropriate
Browse files Browse the repository at this point in the history
In this function, returning `None` indicates success, so instead, a
GPGCli() instance should be returned for the new error cases.

Signed-off-by: Patrick McCarty <[email protected]>
  • Loading branch information
phmccarty committed Jan 18, 2020
1 parent 8814315 commit 8e861e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autospec/pkg_integrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ def verify(self, _, tarfile, signature):
args = self.args + ['--dearmor', '--output', '-', signature]
output, err, code = self.exec_cmd(args)
if code != 0:
return None
return GPGCliStatus(f'Failed to convert {signature} to binary format')
num_bytes = packets[0].get("length")
if not num_bytes:
return None
return GPGCliStatus(f'Cannot verify first signature from {signature}')
first_sig = output[:num_bytes]
with tempfile.NamedTemporaryFile(prefix="newsig-", dir=self._home, delete=False) as new_sig_file:
new_sig_file.write(first_sig)
Expand Down

0 comments on commit 8e861e4

Please sign in to comment.