From ab33e81650eb7f78c2e22111ce7ef2366f3bb542 Mon Sep 17 00:00:00 2001 From: Yuming Zhu Date: Aug 13 2018 20:51:38 +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 0de4d5b..bd47ed4 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")