]> xenbits.xensource.com Git - xen.git/commitdiff
xend: Map re.compile on hosts_allow for XMLRPCServer.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 2 Apr 2007 16:34:00 +0000 (17:34 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 2 Apr 2007 16:34:00 +0000 (17:34 +0100)
Changeset 14601 removed a re.compile() map on hosts_allow,
hence breaking the tcp xmlrpc api ('str' has no attribute match
in xend-debug.log).

From: Pascal Bouchareine <pascal@gandi.net>
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/python/xen/xend/server/SrvServer.py

index 34f2dc4f958b1502d722aad590dd9572f3211fc7..bfb772f82acf16402481e8ac0e5cac2f579494aa 100644 (file)
@@ -212,8 +212,8 @@ def _loadConfig(servers, root, reload):
                     if server_cfg[1] in [XendAPI.AUTH_PAM, XendAPI.AUTH_NONE]:
                         auth_method = server_cfg[1]
 
-                if len(server_cfg) > 2:
-                    hosts_allowed = server_cfg[2] or None
+                if len(server_cfg) > 2 and len(server_cfg[2]):
+                    hosts_allowed = map(re.compile, server_cfg[2].split(' '))
 
                 if len(server_cfg) > 4:
                     # SSL key and cert file