From e751cd851dc0ea69b423e5affa83de337c8e1feb Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: May 06 2020 14:36:19 +0000 Subject: [PATCH 1/2] cli: deprecate --ca Fixes: https://pagure.io/koji/issue/2182 --- diff --git a/cli/koji b/cli/koji index 08bd6d5..2e3d30e 100755 --- a/cli/koji +++ b/cli/koji @@ -121,7 +121,7 @@ def get_options(): parser.add_option("--principal", help=_("specify a Kerberos principal to use")) parser.add_option("--krbservice", help=_("specify the Kerberos service name for the hub")) parser.add_option("--cert", help=_("specify a SSL cert to use"), metavar="FILE") - parser.add_option("--ca", help=_("specify a SSL CA to use"), metavar="FILE") + parser.add_option("--ca", help=SUPPRESS_HELP, metavar="FILE") parser.add_option("--runas", help=_("run as the specified user (requires special privileges)")) parser.add_option("--user", help=_("specify user")) parser.add_option("--password", help=_("specify password")) diff --git a/koji/__init__.py b/koji/__init__.py index edc8ac5..9c3ed94 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -1914,6 +1914,9 @@ def read_config(profile_name, user_config=None): else: result[name] = os.path.expanduser(result[name]) + if result.get('ca'): + util.deprecated("--ca option is deprecated and will be removed in 1.24") + return result diff --git a/util/koji-gc b/util/koji-gc index eafc13c..9465fdd 100755 --- a/util/koji-gc +++ b/util/koji-gc @@ -28,7 +28,7 @@ from six.moves import email_mime_text as MIMEText import koji import koji.policy -from koji.util import LazyDict, LazyValue, to_list +from koji.util import LazyDict, LazyValue, to_list, deprecated try: import krbV @@ -68,8 +68,7 @@ def get_options(): parser.add_option("--network-hack", action="store_true", default=False, help=optparse.SUPPRESS_HELP) # no longer used parser.add_option("--cert", help=_("Client SSL certificate file for authentication")) - parser.add_option("--ca", default='', - help=_("ignored")) # FIXME: remove in next major release + parser.add_option("--ca", help=optparse.SUPPRESS_HELP) # FIXME: remove in next major release parser.add_option("--serverca", help=_("CA cert file that issued the hub certificate")) parser.add_option("-n", "--test", action="store_true", default=False, help=_("test mode")) @@ -182,6 +181,9 @@ def get_options(): (options, args) = parser.parse_args(values=defaults) options.config = config + if options.ca: + deprecated("--ca option is deprecated and will be removed in 1.24") + # figure out actions actions = ('prune', 'trash', 'delete', 'salvage') if options.action: From a0e34318b1fa1b05ac3ba452d9567a83e043c1c5 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: May 07 2020 08:01:04 +0000 Subject: [PATCH 2/2] update comments --- diff --git a/cli/koji b/cli/koji index 2e3d30e..cc50be7 100755 --- a/cli/koji +++ b/cli/koji @@ -121,7 +121,7 @@ def get_options(): parser.add_option("--principal", help=_("specify a Kerberos principal to use")) parser.add_option("--krbservice", help=_("specify the Kerberos service name for the hub")) parser.add_option("--cert", help=_("specify a SSL cert to use"), metavar="FILE") - parser.add_option("--ca", help=SUPPRESS_HELP, metavar="FILE") + parser.add_option("--ca", help=SUPPRESS_HELP, metavar="FILE") # FIXME: remove in 1.24 parser.add_option("--runas", help=_("run as the specified user (requires special privileges)")) parser.add_option("--user", help=_("specify user")) parser.add_option("--password", help=_("specify password")) diff --git a/util/koji-gc b/util/koji-gc index 9465fdd..861d3de 100755 --- a/util/koji-gc +++ b/util/koji-gc @@ -68,7 +68,7 @@ def get_options(): parser.add_option("--network-hack", action="store_true", default=False, help=optparse.SUPPRESS_HELP) # no longer used parser.add_option("--cert", help=_("Client SSL certificate file for authentication")) - parser.add_option("--ca", help=optparse.SUPPRESS_HELP) # FIXME: remove in next major release + parser.add_option("--ca", help=optparse.SUPPRESS_HELP) # FIXME: remove in 1.24 parser.add_option("--serverca", help=_("CA cert file that issued the hub certificate")) parser.add_option("-n", "--test", action="store_true", default=False, help=_("test mode"))