From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9DD56138247 for ; Thu, 19 Dec 2013 06:35:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1673FE0A44; Thu, 19 Dec 2013 06:35:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9E195E0A44 for ; Thu, 19 Dec 2013 06:34:59 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A833F33F5F2 for ; Thu, 19 Dec 2013 06:34:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 051CAE570A for ; Thu, 19 Dec 2013 06:34:57 +0000 (UTC) From: "Devan Franchini" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Devan Franchini" Message-ID: <1387434612.481ba08d57a1314f816ab364e34b08511a1d5a05.twitch153@gentoo> Subject: [gentoo-commits] proj/webapp-config:experimental commit in: WebappConfig/ X-VCS-Repository: proj/webapp-config X-VCS-Files: WebappConfig/config.py X-VCS-Directories: WebappConfig/ X-VCS-Committer: twitch153 X-VCS-Committer-Name: Devan Franchini X-VCS-Revision: 481ba08d57a1314f816ab364e34b08511a1d5a05 X-VCS-Branch: experimental Date: Thu, 19 Dec 2013 06:34:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: e0478d20-623a-43d3-be55-6e269bb3ddd9 X-Archives-Hash: c6484e823a205d5241404213420874ee commit: 481ba08d57a1314f816ab364e34b08511a1d5a05 Author: Devan Franchini gentoo org> AuthorDate: Thu Dec 19 06:30:12 2013 +0000 Commit: Devan Franchini gentoo org> CommitDate: Thu Dec 19 06:30:12 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=481ba08d WebappConfig/config.py: Uses maybe_get() function instead of get(). This changes the use of the get() function in the split_hostname() function in favor of the maybe_get() function. This change still allows vhost_subdomain_# variables to be set in /etc/vhosts/webapp-config without the risk of it being overwritten except due to the use of the maybe_get() function it will no longer give warnings to the user if a vhost_subdomain_# variable is not found. This is ideal because it removes the need of masking the warning in the get() function. X-Gentoo-Bug: 300250 X-Gentoo-Bug-URL: https://bugs.gentoo.org/300250 X-Gentoo-Bug: 349491 X-Gentoo-Bug-URL: https://bugs.gentoo.org/349491 --- WebappConfig/config.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/WebappConfig/config.py b/WebappConfig/config.py index e251ca6..c0ea645 100644 --- a/WebappConfig/config.py +++ b/WebappConfig/config.py @@ -75,8 +75,6 @@ class BashConfigParser(configparser_ConfigParser): 'ures.' if self.error_action == 0: OUT.die(error) - elif self.error_action == 1 and re.search('^vhost_subdomain_\d+', option): - pass elif self.error_action == 1: OUT.warn(error) return '' @@ -996,7 +994,7 @@ class Config: j = len(subdomains) for i in subdomains: - if not self.config.get('USER', 'vhost_subdomain_' + str(j)): + if not self.maybe_get('USER', 'vhost_subdomain_' + str(j)): self.config.set('USER', 'vhost_subdomain_' + str(j), i) OUT.debug('Storing subdomain name', 8)