|
|
|
|
|
|
|
|
|
|
xen-changelog
[Xen-changelog] [xen-unstable] Diagnose bad config files.
# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID 6a6748da20398bd9c6a619cc8ec018ba4e8daaf0
# Parent cf11417d7eb6ed2a12606ba7acf24d30e97edd08
Diagnose bad config files.
Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
tools/python/xen/xm/main.py | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff -r cf11417d7eb6 -r 6a6748da2039 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py Thu Dec 07 16:48:23 2006 +0000
+++ b/tools/python/xen/xm/main.py Thu Dec 07 17:47:43 2006 +0000
@@ -335,17 +335,22 @@ all_commands = (domain_commands + host_c
# Configuration File Parsing
##
+config = None
if os.path.isfile(XM_CONFIG_FILE):
- config = xml.dom.minidom.parse(XM_CONFIG_FILE)
-else:
- config = None
+ try:
+ config = xml.dom.minidom.parse(XM_CONFIG_FILE)
+ except:
+ print >>sys.stderr, ('Ignoring invalid configuration file %s.' %
+ XM_CONFIG_FILE)
def parseServer():
if config:
server = config.getElementsByTagName('server')
if server:
st = server[0].getAttribute('type')
- if st != SERVER_XEN_API:
+ if st != SERVER_XEN_API and st != SERVER_LEGACY_XMLRPC:
+ print >>sys.stderr, ('Invalid server type %s; using %s.' %
+ (st, SERVER_LEGACY_XMLRPC))
st = SERVER_LEGACY_XMLRPC
return (st, server[0].getAttribute('uri'))
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-changelog] [xen-unstable] Diagnose bad config files.,
Xen patchbot-unstable <=
|
|
|
|
|