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 2018/12/19 09:21:37 UTC

[GitHub] ashb commented on a change in pull request #4340: [AIRFLOW-3540] Respect environment config when looking up config file.

ashb commented on a change in pull request #4340: [AIRFLOW-3540] Respect environment config when looking up config file.
URL: https://github.com/apache/incubator-airflow/pull/4340#discussion_r242841851
 
 

 ##########
 File path: airflow/configuration.py
 ##########
 @@ -442,20 +442,15 @@ def mkdir_p(path):
 
 
 # Setting AIRFLOW_HOME and AIRFLOW_CONFIG from environment variables, using
-# "~/airflow" and "~/airflow/airflow.cfg" respectively as defaults.
+# "~/airflow" and "$AIRFLOW_HOME/airflow.cfg" respectively as defaults.
 
-if 'AIRFLOW_HOME' not in os.environ:
-    AIRFLOW_HOME = expand_env_var('~/airflow')
-else:
-    AIRFLOW_HOME = expand_env_var(os.environ['AIRFLOW_HOME'])
+AIRFLOW_HOME = expand_env_var(os.environ.get('AIRFLOW_HOME', '~/airflow'))
 
 mkdir_p(AIRFLOW_HOME)
 
+AIRFLOW_CONFIG = expand_env_var(os.environ)
 
 Review comment:
   This looks suspect - we're passing a dict to `expand_env_var()`, not a single value.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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