- p.wait()
-
- for output in p.stderr.readlines():
- match = gnupg_import_ok_pattern.match(output)
- if match and match.group(2) == "IMPORT_OK":
- fingerprint = str(match.group(4))
- if match.group(3) == "0":
- print("Keyring refreshed successfully...")
- print(" No key updates for key: " + fingerprint)
- elif match.group(3) == "4":
- print("Keyring refreshed successfully...")
- print(" New signatures for key: " + fingerprint)
- else:
- print("Keyring refreshed successfully...")
+ if r.status_code != 200:
+ print(f"Error fetching key, status code = {r.status_code}")
+ else:
+ with open(self.paths["signing_keys"]["wkd_tmp"], "wb") as f:
+ f.write(r.content)
+
+ if self.import_key_and_check_status("wkd_tmp"):
+ print("Key imported successfully")
+ else:
+ print("Key failed to import")