From b1f8b34f8cd947abe950c595a2c32d4992ec7213 Mon Sep 17 00:00:00 2001 From: Leonardo Rochael Almeida Date: Fri, 16 Mar 2018 17:07:57 -0300 Subject: [PATCH] Fix flower broker configuration In case the celery broker is configured with transport options, these options would not be passed into flower with a --broker parameter. So now we pass the whole celery app to flower instead. Also, don't try to start Flower if no Celery broker URL present. --- superset/cli.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/superset/cli.py b/superset/cli.py index 48db7394b9dae..6e1bc8a946739 100755 --- a/superset/cli.py +++ b/superset/cli.py @@ -309,10 +309,18 @@ def flower(port, address): Celery Flower is a UI to monitor the Celery operation on a given broker""" - BROKER_URL = celery_app.conf.BROKER_URL + if not celery_app.conf.BROKER_URL: + print( + Fore.YELLOW + + 'No Celery broker found in your superset configuration.\n' + 'Please provide a CELERY_CONFIG setting, including a BROKER_URL.\n' + 'Not starting Celery Flower.' + + Style.RESET_ALL, + ) + return cmd = ( 'celery flower ' - '--broker={BROKER_URL} ' + '-A superset.cli.celery_app ' '--port={port} ' '--address={address} ' ).format(**locals())