From e512bf7c59ddd81aaa93e31df6297252d490ebd2 Mon Sep 17 00:00:00 2001
From: Tomas Kopecek <tkopecek@redhat.com>
Date: Oct 06 2020 11:48:05 +0000
Subject: remove deprecated --ca option


Fixes: https://pagure.io/koji/issue/2192

---

diff --git a/builder/kojid b/builder/kojid
index 5905ab1..a2c7a0b 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -6495,7 +6495,6 @@ def get_options():
                 'xz_options': '-z6T0',
                 'task_avail_delay': 300,
                 'cert': None,
-                'ca': '',  # FIXME: Unused, remove in next major release
                 'serverca': None}
     if config.has_section('kojid'):
         for name, value in config.items('kojid'):
diff --git a/cli/koji b/cli/koji
index 284230a..382e753 100755
--- a/cli/koji
+++ b/cli/koji
@@ -120,7 +120,6 @@ def get_options():
     parser.add_option("--keytab", help=_("specify a Kerberos keytab to use"), metavar="FILE")
     parser.add_option("--principal", help=_("specify a Kerberos principal to use"))
     parser.add_option("--cert", help=_("specify a SSL cert to use"), 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"))
@@ -149,9 +148,6 @@ def get_options():
                       help=_("list commands"))
     (options, args) = parser.parse_args()
 
-    if options.ca:
-        koji.util.deprecated("--ca option is deprecated and will be removed in 1.24")
-
     # load local config
     try:
         result = koji.read_config(options.profile, user_config=options.configFile)
diff --git a/koji/__init__.py b/koji/__init__.py
index 58c0da5..676782d 100644
--- a/koji/__init__.py
+++ b/koji/__init__.py
@@ -1912,7 +1912,6 @@ def read_config(profile_name, user_config=None):
         'principal': None,
         'keytab': None,
         'cert': None,
-        'ca': '',  # FIXME: remove in next major release
         'serverca': None,
         'no_ssl_verify': False,
         'authtype': None,
@@ -1990,9 +1989,6 @@ def read_config(profile_name, user_config=None):
         else:
             result[name] = os.path.expanduser(result[name])
 
-    if result.get('ca'):
-        util.deprecated("ca option in config file is deprecated and will be removed in 1.24")
-
     return result
 
 
diff --git a/tests/test_cli/test_call.py b/tests/test_cli/test_call.py
index dfba8b8..709ce39 100644
--- a/tests/test_cli/test_call.py
+++ b/tests/test_cli/test_call.py
@@ -74,7 +74,6 @@ class TestCall(utils.CliTestCase):
             'method': 'ssl_login',
             'parameters': {
                 'cert': '/etc/pki/cert',
-                'ca': ['/etc/pki/clientca', '/etc/pki/serverca'],
             },
             'result': 'success'
         }
diff --git a/util/koji-gc b/util/koji-gc
index 591410c..f86e80a 100755
--- a/util/koji-gc
+++ b/util/koji-gc
@@ -27,7 +27,7 @@ from six.moves import email_mime_text as MIMEText
 
 import koji
 import koji.policy
-from koji.util import LazyDict, LazyValue, to_list, deprecated
+from koji.util import LazyDict, LazyValue, to_list
 
 
 def _(args):
@@ -54,7 +54,6 @@ 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 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"))
@@ -131,7 +130,6 @@ def get_options():
         ['password', None, 'string'],
         ['noauth', None, 'boolean'],
         ['cert', None, 'string'],
-        ['ca', None, 'string'],  # FIXME: remove in next major release
         ['serverca', None, 'string'],
         ['server', None, 'string'],
         ['weburl', None, 'string'],
@@ -173,9 +171,6 @@ 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:
diff --git a/util/kojira b/util/kojira
index daea9a6..6e29be7 100755
--- a/util/kojira
+++ b/util/kojira
@@ -1124,7 +1124,6 @@ def get_options():
                 'recent_tasks_lifetime': 600,
                 'sleeptime': 15,
                 'cert': None,
-                'ca': '',  # FIXME: unused, remove in next major release
                 'serverca': None,
                 'queue_file': None,
                 }
@@ -1134,8 +1133,8 @@ def get_options():
                     'max_delete_processes', 'max_repo_tasks_maven', 'dist_repo_lifetime',
                     'sleeptime', 'recent_tasks_lifetime')
         str_opts = ('topdir', 'server', 'user', 'password', 'logfile', 'principal', 'keytab',
-                    'cert', 'ca', 'serverca', 'debuginfo_tags', 'queue_file',
-                    'source_tags', 'separate_source_tags', 'ignore_tags')  # FIXME: remove ca here
+                    'cert', 'serverca', 'debuginfo_tags', 'queue_file',
+                    'source_tags', 'separate_source_tags', 'ignore_tags')
         bool_opts = ('verbose', 'debug', 'ignore_stray_repos', 'offline_retry',
                      'no_ssl_verify', 'check_external_repos')
         legacy_opts = ('with_src', 'delete_batch_size')
diff --git a/vm/kojivmd b/vm/kojivmd
index 8320281..f54ac05 100755
--- a/vm/kojivmd
+++ b/vm/kojivmd
@@ -140,7 +140,6 @@ def get_options():
                 'offline_retry_interval': 120,
                 'allowed_scms': '',
                 'cert': None,
-                'ca': '',  # FIXME: Remove in next major release
                 'serverca': None}
     if config.has_section('kojivmd'):
         for name, value in config.items('kojivmd'):

