airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kengo Seki (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (AIRFLOW-694) Empty env vars do not overwrite non-empty config values
Date Wed, 01 Feb 2017 03:45:52 GMT

     [ https://issues.apache.org/jira/browse/AIRFLOW-694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kengo Seki reassigned AIRFLOW-694:
----------------------------------

              Assignee: Kengo Seki
    External issue URL: https://github.com/apache/incubator-airflow/pull/2044

> Empty env vars do not overwrite non-empty config values
> -------------------------------------------------------
>
>                 Key: AIRFLOW-694
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-694
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: core
>    Affects Versions: Airflow 1.7.1.3
>            Reporter: Rolf Schroeder
>            Assignee: Kengo Seki
>            Priority: Minor
>
> Setting an empty environment variable, ex:
> {noformat}export AIRFLOW__SMTP__SMTP_PASSWORD=""{noformat}
> will not overwrite any config variable which is not empty, ex
> {noformat}
> ...
> [smtp]
> smtp_password = airflow
> {noformat}
> I know that I could simply modify the values in aiflow.cfg. However, my expectation (according
to the docs) was that env vars always overwrite default values. This is clearly not the case.
> {code:title=airflow/configuration.py|borderStyle=solid}
>     def get(self, section, key, **kwargs):
>         section = str(section).lower()
>         key = str(key).lower()
>         # first check environment variables
>         option = self._get_env_var_option(section, key)
>         if option: ## !!!!! empty string will evaluate to False !!!!!
>             return option
>         # ...then the config file
>         if self.has_option(section, key):
>             return expand_env_var(
>                 ConfigParser.get(self, section, key, **kwargs))
> {code}
> If the env var is empty, it will not get used.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message