From 567f9393d29b376a6c6de52f451b21bcc273a5e2 Mon Sep 17 00:00:00 2001 From: Yuming Zhu Date: Thu, 24 May 2018 22:02:28 +0800 Subject: [PATCH] cli: fix KeyError for external RPM in rpminfo command --- cli/koji_cli/commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 0de4d5b9..bd47ed49 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -3024,9 +3024,10 @@ def anon_handle_rpminfo(goptions, session, args): print("Built: %s" % time.strftime('%a, %d %b %Y %H:%M:%S %Z', time.localtime(info['buildtime']))) print("SIGMD5: %(payloadhash)s" % info) print("Size: %(size)s" % info) - headers = session.getRPMHeaders(rpmID=info['id'], headers=["license"]) - print("License: %(license)s" % headers) if not info.get('external_repo_id', 0): + headers = session.getRPMHeaders(rpmID=info['id'], + headers=["license"]) + print("License: %(license)s" % headers) print("Build ID: %(build_id)s" % info) if info['buildroot_id'] is None: print("No buildroot data available")