Skip to content

Commit 582e68a

Browse files
committed
Fix ssl_cert_reqs choices and update data type of newer version of oslo.config
1 parent 21ebac7 commit 582e68a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

st2common/st2common/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def register_opts(ignore_errors=False):
221221
cfg.StrOpt(
222222
"ssl_cert_reqs",
223223
default=None,
224-
choices="none, optional, required",
224+
choices=["none", "optional", "required"],
225225
help="Specifies whether a certificate is required from the other side of the "
226226
"connection, and whether it will be validated if provided",
227227
),
@@ -303,7 +303,7 @@ def register_opts(ignore_errors=False):
303303
cfg.StrOpt(
304304
"ssl_cert_reqs",
305305
default=None,
306-
choices="none, optional, required",
306+
choices=["none", "optional", "required"],
307307
help="Specifies whether a certificate is required from the other side of the "
308308
"connection, and whether it will be validated if provided.",
309309
),

tools/config_gen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import sys
2222
import traceback
2323

24+
from collections import OrderedDict
2425
from oslo_config import cfg
2526

2627

@@ -188,7 +189,7 @@ def _print_options(opt_group, options):
188189
print(("# %s" % opt.help).strip())
189190

190191
if isinstance(opt, cfg.StrOpt) and opt.type.choices:
191-
if isinstance(opt.type.choices, list):
192+
if isinstance(opt.type.choices, OrderedDict):
192193
valid_values = ", ".join([str(x) for x in opt.type.choices])
193194
else:
194195
valid_values = opt.type.choices

0 commit comments

Comments
 (0)