From aa52e31c2925882a1d33c05c5edf4dd591aa6a6e Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Wed, 5 Jun 2024 12:40:57 +0300 Subject: [PATCH] signer: Fix keyid tweaking in import-repo (#358) We only want to fix keyids when the import is actually possible (not when we're just printing out the import json template) --- signer/tuf_on_ci_sign/import_repo.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/signer/tuf_on_ci_sign/import_repo.py b/signer/tuf_on_ci_sign/import_repo.py index 93fab151..2293f4cf 100644 --- a/signer/tuf_on_ci_sign/import_repo.py +++ b/signer/tuf_on_ci_sign/import_repo.py @@ -173,15 +173,15 @@ def import_repo(verbose: int, push: bool, event_name: str, import_file: str | No if not ok: raise AbortEdit("Missing values") - # we have updated keys defined in root/targets: make sure keyids are compliant - repo.force_compliant_keyids("root") - repo.force_compliant_keyids("targets") - if not ok: print("Error: Undefined values found. please save this in a file,") print("fill in the values and use the file as import-file argument:\n") print(json.dumps(import_data, indent=2)) else: + # we have updated keys defined in root/targets: make sure they are compliant + repo.force_compliant_keyids("root") + repo.force_compliant_keyids("targets") + git_expect(["add", "metadata"]) git_expect( ["commit", "-m", f"Repo import by {user_config.name}", "--signoff"]