airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject incubator-airflow git commit: AIRFLOW-339: Ability to pass a flower conf file
Date Thu, 21 Jul 2016 01:09:00 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/master 348f25f08 -> 868efc7a0


AIRFLOW-339: Ability to pass a flower conf file

Closes #1671 from msumit/AIRFLOW-339


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/868efc7a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/868efc7a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/868efc7a

Branch: refs/heads/master
Commit: 868efc7a008e4434b7037aaf52b1a815963865a0
Parents: 348f25f
Author: Sumit Maheshwari <sumitm@qubole.com>
Authored: Wed Jul 20 18:08:48 2016 -0700
Committer: Maxime Beauchemin <maximebeauchemin@gmail.com>
Committed: Wed Jul 20 18:08:48 2016 -0700

----------------------------------------------------------------------
 airflow/bin/cli.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/868efc7a/airflow/bin/cli.py
----------------------------------------------------------------------
diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py
index 455d8da..cf05362 100755
--- a/airflow/bin/cli.py
+++ b/airflow/bin/cli.py
@@ -608,6 +608,10 @@ def flower(args):
     if args.broker_api:
         api = '--broker_api=' + args.broker_api
 
+    flower_conf = ''
+    if args.flower_conf:
+        flower_conf = '--conf=' + args.flower_conf
+
     if args.daemon:
         pid, stdout, stderr, log_file = setup_locations("flower", args.pid, args.stdout,
args.stderr, args.log_file)
         stdout = open(stdout, 'w+')
@@ -620,7 +624,7 @@ def flower(args):
         )
 
         with ctx:
-            os.execvp("flower", ['flower', '-b', broka, address, port, api])
+            os.execvp("flower", ['flower', '-b', broka, address, port, api, flower_conf])
 
         stdout.close()
         stderr.close()
@@ -628,7 +632,7 @@ def flower(args):
         signal.signal(signal.SIGINT, sigint_handler)
         signal.signal(signal.SIGTERM, sigint_handler)
 
-        os.execvp("flower", ['flower', '-b', broka, address, port, api])
+        os.execvp("flower", ['flower', '-b', broka, address, port, api, flower_conf])
 
 
 def kerberos(args):  # noqa
@@ -880,6 +884,9 @@ class CLIFactory(object):
             default=conf.get('celery', 'FLOWER_PORT'),
             type=int,
             help="The port on which to run the server"),
+        'flower_conf': Arg(
+            ("-fc", "--flower_conf"),
+            help="Configuration file for flower"),
         'task_params': Arg(
             ("-tp", "--task_params"),
             help="Sends a JSON params dict to the task"),
@@ -992,7 +999,7 @@ class CLIFactory(object):
         }, {
             'func': flower,
             'help': "Start a Celery Flower",
-            'args': ('flower_hostname', 'flower_port', 'broker_api',
+            'args': ('flower_hostname', 'flower_port', 'flower_conf', 'broker_api',
                      'pid', 'daemon', 'stdout', 'stderr', 'log_file'),
         }, {
             'func': version,


Mime
View raw message