Resent of mail sent on 28.04.
xend: fix bug in option parsing
If you enable legacy tcp xmlrpc in xend's config but omit to enable ssl
the following backtrace is generated when starting xend:
[2010-04-28 16:09:04 15754] ERROR (SrvDaemon:349) Exception starting xend
('NoneType' object has no attribute 'rfind')
Traceback (most recent call last):
File "usr/lib/python2.5/site-packages/xen/xend/server/SrvDaemon.py", line
341, in run
servers = SrvServer.create()
File "usr/lib/python2.5/site-packages/xen/xend/server/SrvServer.py", line
253, in create
_loadConfig(servers, root, False)
File "usr/lib/python2.5/site-packages/xen/xend/server/SrvServer.py", line
233, in _loadConfig
ssl_key_file = xoptions.get_xend_tcp_xmlrpc_server_ssl_key_file()
File "usr/lib/python2.5/site-packages/xen/xend/XendOptions.py", line 210, in
get_xend_tcp_xmlrpc_server_ssl_key_file
if os.path.dirname(file) == "":
File "/usr/lib/python2.5/posixpath.py", line 119, in dirname
return split(p)[0]
File "/usr/lib/python2.5/posixpath.py", line 77, in split
i = p.rfind('/') + 1
This patch fixes above bug.
Patch should be considered for 4.0.x as the bug is present in release 4.0.0.
Signed-off-by: Arnd Hannemann <hannemann@xxxxxxxxxxxxxxxxxxx>
diff -r 9a1d7caa2024 -r 0d3979903bac tools/python/xen/xend/XendOptions.py
--- a/tools/python/xen/xend/XendOptions.py Mon Apr 26 12:13:23 2010 +0100
+++ b/tools/python/xen/xend/XendOptions.py Wed Apr 28 16:54:04 2010 +0200
@@ -207,18 +207,18 @@
def get_xend_tcp_xmlrpc_server_ssl_key_file(self):
name = 'xend-tcp-xmlrpc-server-ssl-key-file'
file = self.get_config_string(name)
- if os.path.dirname(file) == "":
+ if file and os.path.dirname(file) == "":
file = auxbin.xen_configdir() + '/' + file;
- if not os.path.exists(file):
+ if file and not os.path.exists(file):
raise XendError("invalid xend config %s: directory '%s' does not
exist" % (name, file))
return file
def get_xend_tcp_xmlrpc_server_ssl_cert_file(self):
name = 'xend-tcp-xmlrpc-server-ssl-cert-file'
file = self.get_config_string(name)
- if os.path.dirname(file) == "":
+ if file and os.path.dirname(file) == "":
file = auxbin.xen_configdir() + '/' + file;
- if not os.path.exists(file):
+ if file and not os.path.exists(file):
raise XendError("invalid xend config %s: directory '%s' does not
exist" % (name, file))
return file
fix_xend_xmlrpc_tcp_without_ssl.patch
Description: Text Data
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|