From 9910ec089916f5ff870966a11b69efcbae87d49b Mon Sep 17 00:00:00 2001 From: Yu Ming Zhu Date: May 15 2020 08:15:20 +0000 Subject: [PATCH 1/2] deprecated warning for cli option --ca as well fixes: #2182 --- diff --git a/cli/koji b/cli/koji index cc50be7..8b50a8a 100755 --- a/cli/koji +++ b/cli/koji @@ -168,6 +168,9 @@ def get_options(): value = os.path.expanduser(getattr(options, name)) setattr(options, name, value) + if options.ca: + koji.util.deprecated("--ca option is deprecated and will be removed in 1.24") + # honor topdir if options.topdir: koji.BASEDIR = options.topdir diff --git a/koji/__init__.py b/koji/__init__.py index 9c3ed94..edc8ac5 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -1914,9 +1914,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 is deprecated and will be removed in 1.24") - return result From 5ce2418ae73899f4fc196384a2d56195d3bc49a0 Mon Sep 17 00:00:00 2001 From: Yu Ming Zhu Date: May 15 2020 13:12:20 +0000 Subject: [PATCH 2/2] warning for both cli and config file option --- diff --git a/cli/koji b/cli/koji index 8b50a8a..d4e1d93 100755 --- a/cli/koji +++ b/cli/koji @@ -150,6 +150,9 @@ 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) @@ -168,9 +171,6 @@ def get_options(): value = os.path.expanduser(getattr(options, name)) setattr(options, name, value) - if options.ca: - koji.util.deprecated("--ca option is deprecated and will be removed in 1.24") - # honor topdir if options.topdir: koji.BASEDIR = options.topdir diff --git a/koji/__init__.py b/koji/__init__.py index edc8ac5..8f02523 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 in config file is deprecated and will be removed in 1.24") + return result