1 |
commit: fca6446d6c9181d6956676309dfc5a34f9aaca29 |
2 |
Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 19 06:30:12 2013 +0000 |
4 |
Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 25 03:13:16 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=fca6446d |
7 |
|
8 |
WebappConfig/config.py: Uses maybe_get() function instead of get(). |
9 |
|
10 |
This changes the use of the get() function in the split_hostname() |
11 |
function in favor of the maybe_get() function. This change still |
12 |
allows vhost_subdomain_# variables to be set in /etc/vhosts/webapp-config |
13 |
without the risk of it being overwritten except due to the use of the |
14 |
maybe_get() function it will no longer give warnings to the user if |
15 |
a vhost_subdomain_# variable is not found. This is ideal because |
16 |
it removes the need of masking the warning in the get() function. |
17 |
|
18 |
X-Gentoo-Bug: 300250 |
19 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/300250 |
20 |
X-Gentoo-Bug: 349491 |
21 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/349491 |
22 |
|
23 |
--- |
24 |
WebappConfig/config.py | 4 +--- |
25 |
1 file changed, 1 insertion(+), 3 deletions(-) |
26 |
|
27 |
diff --git a/WebappConfig/config.py b/WebappConfig/config.py |
28 |
index e251ca6..c0ea645 100644 |
29 |
--- a/WebappConfig/config.py |
30 |
+++ b/WebappConfig/config.py |
31 |
@@ -75,8 +75,6 @@ class BashConfigParser(configparser_ConfigParser): |
32 |
'ures.' |
33 |
if self.error_action == 0: |
34 |
OUT.die(error) |
35 |
- elif self.error_action == 1 and re.search('^vhost_subdomain_\d+', option): |
36 |
- pass |
37 |
elif self.error_action == 1: |
38 |
OUT.warn(error) |
39 |
return '' |
40 |
@@ -996,7 +994,7 @@ class Config: |
41 |
|
42 |
j = len(subdomains) |
43 |
for i in subdomains: |
44 |
- if not self.config.get('USER', 'vhost_subdomain_' + str(j)): |
45 |
+ if not self.maybe_get('USER', 'vhost_subdomain_' + str(j)): |
46 |
self.config.set('USER', 'vhost_subdomain_' + str(j), i) |
47 |
|
48 |
OUT.debug('Storing subdomain name', 8) |