From 25a73064123236529c1abfc9a9feb81c58c96de5 Mon Sep 17 00:00:00 2001 From: Pedro Henrique Date: Mon, 12 Feb 2024 10:33:48 -0300 Subject: [PATCH] Fix devstack runprocess for cloudkitty api After the commit https://github.com/openstack/pbr/commit/8778c64776b092065988d92865ebaf2892930493 The module PBR in openstack started to validating the parameters when creating an embedded WSGI, now if invalid arguments are given to the cloudkitty-api it raises an error as we are facing in the devstack when using `CLOUDKITTY_USE_MOD_WSGI=False`: cloudkitty-api[86126]: usage: cloudkitty-api [-h] [--port PORT] [--host IP] -- [passed options] cloudkitty-api[86126]: cloudkitty-api: error: unrecognized arguments: --config-file=/etc/cloudkitty/cloudkitty.conf This PR also extracts the upgrade database workflow to a function to be used in grenade tests Change-Id: Ifc1a8563a9efcae2abaa6f8eb036405a93ff296d --- devstack/plugin.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 5357a348..993afeb1 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -279,7 +279,7 @@ function init_cloudkitty { create_opensearch_index # Migrate cloudkitty database - $CLOUDKITTY_BIN_DIR/cloudkitty-dbsync upgrade + upgrade_cloudkitty_database # Init the storage backend if [ $CLOUDKITTY_STORAGE_BACKEND == 'hybrid' ]; then @@ -381,7 +381,7 @@ function install_cloudkitty { function start_cloudkitty { run_process ck-proc "$CLOUDKITTY_BIN_DIR/cloudkitty-processor --config-file=$CLOUDKITTY_CONF" if [[ "$CLOUDKITTY_USE_MOD_WSGI" == "False" ]]; then - run_process ck-api "$CLOUDKITTY_BIN_DIR/cloudkitty-api --config-file=$CLOUDKITTY_CONF" + run_process ck-api "$CLOUDKITTY_BIN_DIR/cloudkitty-api --host $CLOUDKITTY_SERVICE_HOST --port $CLOUDKITTY_SERVICE_PORT" elif is_service_enabled ck-api; then enable_apache_site cloudkitty echo_summary "Waiting 15s for cloudkitty-processor to authenticate against keystone before apache is restarted." @@ -443,6 +443,11 @@ function update_horizon_static { restart_apache_server } +# Upgrade cloudkitty database +function upgrade_cloudkitty_database { + $CLOUDKITTY_BIN_DIR/cloudkitty-dbsync upgrade +} + # configure_cloudkitty_dashboard() - Set config files, create data dirs, etc function configure_cloudkitty_dashboard { sudo ln -s $CLOUDKITTY_ENABLED_DIR/_[0-9]*.py \