You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/09/30 09:01:35 UTC

[GitHub] [airflow] ashb commented on a change in pull request #6200: Allow user to specify webserver_config.py path via env or configurati…

ashb commented on a change in pull request #6200: Allow user to specify webserver_config.py path via env or configurati…
URL: https://github.com/apache/airflow/pull/6200#discussion_r329474445
 
 

 ##########
 File path: airflow/configuration.py
 ##########
 @@ -567,8 +567,12 @@ def get_airflow_test_config(airflow_home):
         AIRFLOW_HOME = conf.get('core', 'airflow_home')
         warnings.warn(msg, category=DeprecationWarning)
 
-
-WEBSERVER_CONFIG = AIRFLOW_HOME + '/webserver_config.py'
+if 'WEBSERVER_CONFIG' in os.environ:
+    WEBSERVER_CONFIG = os.environ['WEBSERVER_CONFIG']
+elif conf.get('webserver', 'webserver_config'):
+    WEBSERVER_CONFIG = conf.get('webserver', 'webserver_config')
 
 Review comment:
   'webserver', 'webserver_config' is a little bit... "duplicatey". How about 'webserver', 'config_file'?
   
   That way it could be set via `AIRFLOW__WEBSERVER__CONFIG_FILE` environment variable automatically.
   
   Also we can use the `fallback` arg so all of this just becomes:
   
   
   ```python
   WEBSERVER_CONFIG=confi.get('webserver', 'config_file', fallback=AIRFLOW_HOME + '/webserver_config.py')
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services