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 1E700200C0F for ; Thu, 2 Feb 2017 14:40:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1CFB0160B57; Thu, 2 Feb 2017 13:40:07 +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 66B40160B54 for ; Thu, 2 Feb 2017 14:40:06 +0100 (CET) Received: (qmail 26869 invoked by uid 500); 2 Feb 2017 13:40:04 -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 26860 invoked by uid 99); 2 Feb 2017 13:40:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Feb 2017 13:40:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 82D371A0272 for ; Thu, 2 Feb 2017 13:40:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id zPZpjf2eGq5V for ; Thu, 2 Feb 2017 13:40:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7E9DF5FB76 for ; Thu, 2 Feb 2017 13:40:02 +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 CEBA0E041D for ; Thu, 2 Feb 2017 13:39:52 +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 D568025290 for ; Thu, 2 Feb 2017 13:39:51 +0000 (UTC) Date: Thu, 2 Feb 2017 13:39:51 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (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:07 -0000 [ https://issues.apache.org/jira/browse/AIRFLOW-694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15849911#comment-15849911 ] ASF subversion and git services commented on AIRFLOW-694: --------------------------------------------------------- Commit 3e6b923f88ea012b750e1d8c089dffa5e70a586e in incubator-airflow's branch refs/heads/master from [~sekikn] [ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=3e6b923 ] [AIRFLOW-694] Fix config behaviour for empty envvar Currently, environment variable with empty value does not overwrite the configuration value corresponding to it. Closes #2044 from sekikn/AIRFLOW-694 > 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)