Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1422F200C1E for ; Thu, 2 Feb 2017 14:40:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 12B29160B54; Thu, 2 Feb 2017 13:40:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 675AB160B57 for ; Thu, 2 Feb 2017 14:40:03 +0100 (CET) Received: (qmail 25837 invoked by uid 500); 2 Feb 2017 13:40:01 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 25443 invoked by uid 99); 2 Feb 2017 13:40:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Feb 2017 13:40:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D7264C1225 for ; Thu, 2 Feb 2017 13:40:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id PCJ7kVUMOf6q for ; Thu, 2 Feb 2017 13:40:00 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 936005F30B for ; Thu, 2 Feb 2017 13:39:54 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 3568AE05A2 for ; Thu, 2 Feb 2017 13:39:53 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id EB72F2529C for ; Thu, 2 Feb 2017 13:39:51 +0000 (UTC) Date: Thu, 2 Feb 2017 13:39:51 +0000 (UTC) From: "Bolke de Bruin (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (AIRFLOW-694) Empty env vars do not overwrite non-empty config values MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 02 Feb 2017 13:40:04 -0000 [ 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)