From 15f409c5fcb9879ba494ca2fc11a983010cdcfad Mon Sep 17 00:00:00 2001 From: Yuming Zhu Date: Dec 03 2019 08:40:19 +0000 Subject: list-pkgs: fix opts check fixes: #1779 --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 32a98c0..931d51b 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -2980,11 +2980,14 @@ def anon_handle_list_pkgs(goptions, session, args): event['timestr'] = time.asctime(time.localtime(event['ts'])) print("Querying at event %(id)i (%(timestr)s)" % event) - if not opts['tagID'] and not opts['userID'] and not opts['pkgID']: - if opts['event']: - parser.error("--event and --ts makes sense only with --tag, --owner or --package") - if opts['show_blocked']: - parser.error("--show-blocked makes sense only with --tag, --owner or --package") + if not opts.get('tagID') and not opts.get('userID') and \ + not opts.get('pkgID'): + if opts.get('event'): + parser.error("--event and --ts makes sense only with --tag," + " --owner or --package") + if options.show_blocked: + parser.error("--show-blocked makes sense only with --tag," + " --owner or --package") data = session.listPackages(**opts) if not data: