From aec2ca94686f016c343cc4b97c2e310bb135fd27 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 6 Aug 2021 16:50:06 +0100 Subject: [PATCH] db: Exclude the 'use_db_reconnect' option Build on changes I714dce969088e17caaa1daddc881ebca6834e0f1, which modified how we registered options for both the main and API databases, and Iad2e4da4546b80a016e477577d23accb2606a6e4, which removed support for experimental database reconnects, and start ignoring the 'use_db_reconnect' option. This means the option will no longer appear in our documentation and won't be recognised by any of the validation tooling if present in a nova.conf file. No tests are present because I'm not entirely sure how to test the thing. You can validate it manually though by attempting to set the option in a test and watch things blow up like so: oslo_config.cfg.NoSuchOptError: no such option use_db_reconnect in group [database] A second unnecessary 'deepcopy()' is removed. This was missed in change I714dce969088e17caaa1daddc881ebca6834e0f1. Change-Id: Ie7e4ccaf32f7222b8e305a38b48de7980744a98f Signed-off-by: Stephen Finucane --- nova/conf/database.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nova/conf/database.py b/nova/conf/database.py index f6223f65cc..8be29f380e 100644 --- a/nova/conf/database.py +++ b/nova/conf/database.py @@ -47,10 +47,15 @@ This group should **not** be configured for the ``nova-compute`` service. main_db_opts = copy.deepcopy(oslo_db_opts.database_opts) api_db_opts = copy.deepcopy(oslo_db_opts.database_opts) +# We don't support the experimental use of database reconnect on connection +# lost, so remove the config option that would suggest we do +main_db_opts = [opt for opt in main_db_opts if opt.name != 'use_db_reconnect'] +api_db_opts = [opt for opt in main_db_opts if opt.name != 'use_db_reconnect'] + def register_opts(conf): - conf.register_opts(copy.deepcopy(main_db_opts), group=main_db_group) - conf.register_opts(copy.deepcopy(api_db_opts), group=api_db_group) + conf.register_opts(main_db_opts, group=main_db_group) + conf.register_opts(api_db_opts, group=api_db_group) def list_opts():