From 72db8fdc137447e6c2606f623153eccb36eaacb3 Mon Sep 17 00:00:00 2001 From: Yuming Zhu Date: May 24 2018 14:02:28 +0000 Subject: cli: fix KeyError for external RPM in rpminfo command --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index a9c14ac..d35e7fa 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")