Joe Jasinski created AIRFLOW-2572:
-------------------------------------

             Summary: Airflow /admin/configurationview/ Running Configuration 
not accurate
                 Key: AIRFLOW-2572
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2572
             Project: Apache Airflow
          Issue Type: Bug
    Affects Versions: 1.9.1
         Environment: Debian 8 (in a Docker container)
            Reporter: Joe Jasinski


The admin Runtime Configuration section of /admin/configurationview/ is showing 
config settings from the config file but not the environment variables set. 

When that page renders, this loop is called, which uses the config.as_dict() 
method:

https://github.com/apache/incubator-airflow/blob/master/airflow/www/views.py#L2868

The conf.as_dict() method doesn't properly read in from the environment 
variables. In the example below, see how we can get the expected value from 
conf.get() but not from conf.as_dict().  I think it has to do with the 
implementation of as_dict()

export 
AIRFLOW__CORE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:****@postgres:5432/airflow

>>> from airflow import configuration as conf
>>> import os
>>> os.environ["AIRFLOW__CORE__SQL_ALCHEMY_CONN"]
'postgresql+psycopg2://airflow:****@postgres:5432/airflow'
>>> dict(conf.as_dict(True, True))['core']['sql_alchemy_conn']
('sqlite:////usr/local/airflow/airflow/airflow.db', 'bash cmd')
>>> conf.get('core', 'sql_alchemy_conn')
'postgresql+psycopg2://airflow:****@postgres:5432/airflow'



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to