From 9e196264daa7b395f8f247470c9b24a879dceaa4 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jun 24 2020 08:53:51 +0000 Subject: PR#2085: hide local --debug options Merges #2085 https://pagure.io/koji/pull-request/2085 Fixes: #2084 https://pagure.io/koji/issue/2084 list-signed has separate --debug option --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 21678d7..949dd63 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -1559,7 +1559,7 @@ def handle_write_signed_rpm(goptions, session, args): session.writeSignedRPM(rpminfo['id'], key) -def handle_prune_signed_copies(options, session, args): +def handle_prune_signed_copies(goptions, session, args): "[admin] Prune signed copies" usage = _("usage: %prog prune-sigs [options]") parser = OptionParser(usage=get_usage_str(usage)) @@ -1577,7 +1577,9 @@ def handle_prune_signed_copies(options, session, args): parser.add_option("--protect-tag-file", help=_("File to read tag protect patterns from")) parser.add_option("--trashcan-tag", default="trashcan", help=_("Specify trashcan tag")) - parser.add_option("--debug", action="store_true", help=_("Show debugging output")) + # Don't use local debug option, this one stays here for backward compatibility + # https://pagure.io/koji/issue/2084 + parser.add_option("--debug", action="store_true", default=goptions.debug, help=SUPPRESS_HELP) (options, args) = parser.parse_args(args) # different ideas/modes # 1) remove all signed copies of builds that are not latest for some tag @@ -2068,7 +2070,9 @@ def handle_list_signed(goptions, session, args): "[admin] List signed copies of rpms" usage = _("usage: %prog list-signed [options]") parser = OptionParser(usage=get_usage_str(usage)) - parser.add_option("--debug", action="store_true") + # Don't use local debug option, this one stays here for backward compatibility + # https://pagure.io/koji/issue/2084 + parser.add_option("--debug", action="store_true", default=goptions.debug, help=SUPPRESS_HELP) parser.add_option("--key", help=_("Only list RPMs signed with this key")) parser.add_option("--build", help=_("Only list RPMs from this build")) parser.add_option("--rpm", help=_("Only list signed copies for this RPM")) @@ -2147,7 +2151,7 @@ def handle_list_signed(goptions, session, args): builddir = koji.pathinfo.build(binfo) signedpath = "%s/%s" % (builddir, koji.pathinfo.signed(rinfo, sigkey)) if not os.path.exists(signedpath): - if options.debug: + if goptions.debug: print("No copy: %s" % signedpath) continue print(signedpath) @@ -4148,7 +4152,9 @@ def anon_handle_list_tag_history(goptions, session, args): "[info] Print a history of tag operations" usage = _("usage: %prog list-tag-history [options]") parser = OptionParser(usage=get_usage_str(usage)) - parser.add_option("--debug", action="store_true") + # Don't use local debug option, this one stays here for backward compatibility + # https://pagure.io/koji/issue/2084 + parser.add_option("--debug", action="store_true", default=goptions.debug, help=SUPPRESS_HELP) parser.add_option("--build", help=_("Only show data for a specific build")) parser.add_option("--package", help=_("Only show data for a specific package")) parser.add_option("--tag", help=_("Only show data for a specific tag")) @@ -4447,7 +4453,9 @@ def anon_handle_list_history(goptions, session, args): "[info] Display historical data" usage = _("usage: %prog list-history [options]") parser = OptionParser(usage=get_usage_str(usage)) - parser.add_option("--debug", action="store_true") + # Don't use local debug option, this one stays here for backward compatibility + # https://pagure.io/koji/issue/2084 + parser.add_option("--debug", action="store_true", default=goptions.debug, help=SUPPRESS_HELP) parser.add_option("--build", help=_("Only show data for a specific build")) parser.add_option("--package", help=_("Only show data for a specific package")) parser.add_option("--tag", help=_("Only show data for a specific tag"))