From 77237cb9c487d8c872e5728dc52641abde6e251a Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Tue, 22 May 2018 11:03:35 +0200 Subject: [PATCH] Add --enabled --ready filters for list-channels Fixes: https://pagure.io/koji/issue/939 --- cli/koji_cli/commands.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index c0e4f1b2..330b9491 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -2708,12 +2708,16 @@ def anon_handle_list_channels(goptions, session, args): parser = OptionParser(usage=usage) parser.add_option("--quiet", action="store_true", default=goptions.quiet, help=_("Do not print header information")) + parser.add_option("--ready", action="store_true", + help=_("List only ready builders")) + parser.add_option("--enabled", action="store_true", + help=_("List only enabled builders")) (options, args) = parser.parse_args(args) activate_session(session, goptions) channels = session.listChannels() session.multicall = True for channel in channels: - session.listHosts(channelID=channel['id']) + session.listHosts(channelID=channel['id'], ready=options.ready, enabled=options.enabled) for channel, hosts in zip(channels, session.multiCall()): channel['hosts'] = len(hosts[0]) if not options.quiet: