summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevan Franchini <twitch153@gentoo.org>2013-12-19 01:30:12 -0500
committerDevan Franchini <twitch153@gentoo.org>2014-01-24 22:13:16 -0500
commitfca6446d6c9181d6956676309dfc5a34f9aaca29 (patch)
tree21bedb1b7d97dc5a8cd55550789ba0127802ed3c
parentWebappConfig/config.py: Prevents overwriting config variables. (diff)
downloadwebapp-config-fca6446d6c9181d6956676309dfc5a34f9aaca29.tar.gz
webapp-config-fca6446d6c9181d6956676309dfc5a34f9aaca29.tar.bz2
webapp-config-fca6446d6c9181d6956676309dfc5a34f9aaca29.zip
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
-rw-r--r--WebappConfig/config.py4
1 files changed, 1 insertions, 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)