From fb70e3b3c1e2ff25595a0426287327e5b38e50e4 Mon Sep 17 00:00:00 2001 From: Ann Taraday Date: Wed, 15 Apr 2020 20:11:07 +0400 Subject: [PATCH] Run taskflow jobboard conductor conditionally Run taskflow jobboard conductor only if amphorav2 provider is enabled. Fixes devstack plugin.sh conditions for amphorav2 provider. Change-Id: I49b587cf748996658859667485400307205d209b --- devstack/plugin.sh | 8 ++++---- octavia/controller/queue/v2/consumer.py | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 4f8bcc5fb2..165487934b 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -280,7 +280,7 @@ function octavia_configure { iniset $OCTAVIA_CONF api_settings api_handler queue_producer iniset $OCTAVIA_CONF database connection "mysql+pymysql://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:3306/octavia" - if [[ ${OCTAVIA_ENABLE_AMPHORAV2_PROVIDER} = True ]]; then + if [[ ${OCTAVIA_ENABLE_AMPHORAV2_PROVIDER} == True ]]; then iniset $OCTAVIA_CONF task_flow persistence_connection "mysql+pymysql://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:3306/octavia_persistence" fi # Configure keystone auth_token for all users @@ -357,7 +357,7 @@ function octavia_configure { recreate_database_mysql octavia octavia-db-manage upgrade head - if [[ ${OCTAVIA_ENABLE_AMPHORAV2_PROVIDER} = True ]]; then + if [[ ${OCTAVIA_ENABLE_AMPHORAV2_PROVIDER} == True ]]; then recreate_database_mysql octavia_persistence octavia-db-manage upgrade_persistence fi @@ -368,7 +368,7 @@ function octavia_configure { fi # amphorav2 required redis installation - if [[ ${OCTAVIA_ENABLE_AMPHORAV2_PROVIDER} = True ]]; then + if [[ ${OCTAVIA_ENABLE_AMPHORAV2_PROVIDER} == True ]]; then install_redis fi @@ -657,7 +657,7 @@ function octavia_cleanup { sudo rm -rf $NOVA_STATE_PATH $NOVA_AUTH_CACHE_DIR - if [[ ${OCTAVIA_ENABLE_AMPHORAV2_PROVIDER} = True ]]; then + if [[ ${OCTAVIA_ENABLE_AMPHORAV2_PROVIDER} == True ]]; then uninstall_redis fi diff --git a/octavia/controller/queue/v2/consumer.py b/octavia/controller/queue/v2/consumer.py index 36b2a20d9e..3224ffe2bc 100644 --- a/octavia/controller/queue/v2/consumer.py +++ b/octavia/controller/queue/v2/consumer.py @@ -13,6 +13,7 @@ # under the License. import cotyledon +from oslo_config import cfg from oslo_log import log as logging import oslo_messaging as messaging from oslo_messaging.rpc import dispatcher @@ -24,6 +25,8 @@ from octavia.controller.queue.v2 import endpoints LOG = logging.getLogger(__name__) +CONF = cfg.CONF + class ConsumerService(cotyledon.Service): @@ -47,9 +50,11 @@ class ConsumerService(cotyledon.Service): access_policy=self.access_policy ) self.message_listener.start() - for e in self.endpoints: - e.worker.services_controller.run_conductor( - 'octavia-task-flow-conductor-%s' % uuidutils.generate_uuid()) + if constants.AMPHORAV2 in CONF.api_settings.enabled_provider_drivers: + for e in self.endpoints: + e.worker.services_controller.run_conductor( + 'octavia-task-flow-conductor-%s' % + uuidutils.generate_uuid()) def terminate(self): if self.message_listener: