From 4901ebca8670f6c3be75a7692f8d7c9870a002b4 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sun, 29 Nov 2020 15:23:21 +0100 Subject: Test if Mageia key is already present --- backend/raw_write.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/raw_write.py b/backend/raw_write.py index 58417f9..30b658c 100755 --- a/backend/raw_write.py +++ b/backend/raw_write.py @@ -127,6 +127,7 @@ class Dumper(object): def _get_sum(self, source): self.return_state = False + mageia_keyid = "835E41F4EDCA7A90" logging.debug("Starting getting sum") # Check if the sum file has a valid signature gpg = gnupg.GPG() @@ -136,7 +137,11 @@ class Dumper(object): sig_file = "{}.{}.gpg".format(source, self.sum_type) self.source_file = "{}.{}".format(source, self.sum_type) try: - gpg.recv_keys('pool.sks-keyservers.net', 'EDCA7A90') + keys_list = gpg.list_keys() + if mageia_keyid in [entry['keyid'] for entry in keys_list]: + logging.info("Mageia key already present") + else: + gpg.recv_keys('pool.sks-keyservers.net', mageia_keyid) self.sum_check_searched = True with open(sig_file, 'rb') as g: self.signature_found = True -- cgit v1.2.1