From 8e861e4e0b9b8c5c60a7192bbbb37882799d7728 Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Fri, 17 Jan 2020 17:33:40 -0800 Subject: [PATCH] pkg_integrity: return GPGCli() instances where appropriate 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 --- autospec/pkg_integrity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autospec/pkg_integrity.py b/autospec/pkg_integrity.py index 463e12ab..26712690 100644 --- a/autospec/pkg_integrity.py +++ b/autospec/pkg_integrity.py @@ -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)