Skip to content

Commit

Permalink
Fix ssl_cert_reqs choices and update data type of newer version of os…
Browse files Browse the repository at this point in the history
…lo.config
  • Loading branch information
nzlosh committed Mar 13, 2024
1 parent 21ebac7 commit 582e68a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions st2common/st2common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
Expand Down Expand Up @@ -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.",
),
Expand Down
3 changes: 2 additions & 1 deletion tools/config_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import sys
import traceback

from collections import OrderedDict
from oslo_config import cfg


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 582e68a

Please sign in to comment.