WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Diagnose bad config files.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Diagnose bad config files.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 08 Dec 2006 13:20:41 +0000
Delivery-date: Fri, 08 Dec 2006 05:23:43 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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 <=