From 459022c7786b454c11aa8abd75e8a43b04ea94af Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 3 Jun 2025 22:46:33 +0900 Subject: [PATCH] devstack: Drop redundant AODH_BACKEND Database backend used by aodh is selected according to DATABASE_TYPE environment, and AODH_BACKEND has no effect. Change-Id: If9a99fa00f990d061f884cf8e40f3515845d7949 --- .zuul.yaml | 2 -- devstack/README.rst | 2 +- devstack/plugin.sh | 21 +++------------------ devstack/settings | 3 --- 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index a03c34646..dd8941714 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -72,7 +72,6 @@ mysql: false devstack_localrc: DATABASE_TYPE: postgresql - AODH_BACKEND: postgresql USE_PYTHON3: True devstack_local_conf: test-config: @@ -91,7 +90,6 @@ irrelevant-files: *aodh-irrelevant-files vars: devstack_localrc: - AODH_BACKEND: "mysql" USE_PYTHON3: True devstack_local_conf: test-config: diff --git a/devstack/README.rst b/devstack/README.rst index 6ec6027be..cf866817f 100644 --- a/devstack/README.rst +++ b/devstack/README.rst @@ -17,7 +17,7 @@ Enabling Aodh in DevStack enable_plugin aodh https://opendev.org/openstack/aodh stable/mitaka - There are some options, such as AODH_BACKEND, defined in + There are some options, such as AODH_COORDINATION_URL, defined in ``aodh/devstack/settings``, they can be used to configure the installation of Aodh. If you don't want to use their default value, you can set a new one in ``local.conf``. diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 271c84c7b..2fa3aec26 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -9,7 +9,6 @@ # By default all aodh services are started (see # devstack/settings). # -# AODH_BACKEND: Database backend (e.g. 'mysql') # AODH_COORDINATION_URL: URL for group membership service provided by tooz. # Support potential entry-points console scripts in VENV or not @@ -82,15 +81,6 @@ function cleanup_aodh { remove_uwsgi_config "$AODH_UWSGI_CONF" "aodh" } -# Set configuration for storage backend. -function _aodh_configure_storage_backend { - if [ "$AODH_BACKEND" = 'mysql' ] || [ "$AODH_BACKEND" = 'postgresql' ] ; then - iniset $AODH_CONF database connection $(database_connection_url aodh) - else - die $LINENO "Unable to configure unknown AODH_BACKEND $AODH_BACKEND" - fi -} - # Configure Aodh function configure_aodh { iniset_rpc_backend aodh $AODH_CONF @@ -120,8 +110,7 @@ function configure_aodh { configure_keystone_authtoken_middleware $AODH_CONF aodh - # Configured storage - _aodh_configure_storage_backend + iniset $AODH_CONF database connection $(database_connection_url aodh) # NOTE: This must come after database configuration as those can # call cleanup_aodh which will wipe the WSGI config. @@ -135,12 +124,8 @@ function init_aodh { # Get aodh keystone settings in place _aodh_create_accounts - if is_service_enabled mysql postgresql; then - if [ "$AODH_BACKEND" = 'mysql' ] || [ "$AODH_BACKEND" = 'postgresql' ] ; then - recreate_database aodh - $AODH_BIN_DIR/aodh-dbsync - fi - fi + recreate_database aodh + $AODH_BIN_DIR/aodh-dbsync } # Install Aodh. diff --git a/devstack/settings b/devstack/settings index 22321f39b..dc4ea4c4f 100644 --- a/devstack/settings +++ b/devstack/settings @@ -13,9 +13,6 @@ AODH_CONF=$AODH_CONF_DIR/aodh.conf AODH_UWSGI_CONF=$AODH_CONF_DIR/aodh-uwsgi.ini AODH_UWSGI=aodh.wsgi.api:application -# Set up database backend -AODH_BACKEND=${AODH_BACKEND:-mysql} - # Aodh connection info. AODH_SERVICE_PROTOCOL=http AODH_SERVICE_HOST=${AODH_SERVICE_HOST:-$SERVICE_HOST}