From 582e68a2a88c008a6ff5a4aafacd2db8aaebff57 Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 13 Mar 2024 15:26:34 +0100 Subject: [PATCH] Fix ssl_cert_reqs choices and update data type of newer version of oslo.config --- st2common/st2common/config.py | 4 ++-- tools/config_gen.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/st2common/st2common/config.py b/st2common/st2common/config.py index c88955e4bbd..d22e1367dfa 100644 --- a/st2common/st2common/config.py +++ b/st2common/st2common/config.py @@ -221,7 +221,7 @@ def register_opts(ignore_errors=False): cfg.StrOpt( "ssl_cert_reqs", default=None, - choices="none, optional, required", + choices=["none", "optional", "required"], help="Specifies whether a certificate is required from the other side of the " "connection, and whether it will be validated if provided", ), @@ -303,7 +303,7 @@ def register_opts(ignore_errors=False): cfg.StrOpt( "ssl_cert_reqs", default=None, - choices="none, optional, required", + choices=["none", "optional", "required"], help="Specifies whether a certificate is required from the other side of the " "connection, and whether it will be validated if provided.", ), diff --git a/tools/config_gen.py b/tools/config_gen.py index a0343a94652..f139474c13b 100755 --- a/tools/config_gen.py +++ b/tools/config_gen.py @@ -21,6 +21,7 @@ import sys import traceback +from collections import OrderedDict from oslo_config import cfg @@ -188,7 +189,7 @@ def _print_options(opt_group, options): print(("# %s" % opt.help).strip()) if isinstance(opt, cfg.StrOpt) and opt.type.choices: - if isinstance(opt.type.choices, list): + if isinstance(opt.type.choices, OrderedDict): valid_values = ", ".join([str(x) for x in opt.type.choices]) else: valid_values = opt.type.choices