You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Bolke de Bruin (JIRA)" <ji...@apache.org> on 2017/02/02 13:39:51 UTC
[jira] [Resolved] (AIRFLOW-694) Empty env vars do not overwrite
non-empty config values
[ https://issues.apache.org/jira/browse/AIRFLOW-694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bolke de Bruin resolved AIRFLOW-694.
------------------------------------
Resolution: Fixed
Fix Version/s: 1.8.1
Issue resolved by pull request #2044
[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
> Fix For: 1.8.1
>
>
> 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)