Merge "Run taskflow jobboard conductor conditionally"

This commit is contained in:
Zuul 2020-04-16 11:41:23 +00:00 committed by Gerrit Code Review
commit 0ccb997793
2 changed files with 12 additions and 7 deletions

View File

@ -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

View File

@ -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: