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] Better formatting of error messages for xmlrpclib.Faults

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Better formatting of error messages for xmlrpclib.Faults, matching similar code
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 31 Mar 2006 01:06:09 +0000
Delivery-date: Fri, 31 Mar 2006 01:08:20 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 94971fe9c62a82886ff2dec11b17418b5f25e73f
# Parent  1d0bd5ea2c870944980dd45f0a93fb278af2e8f6
Better formatting of error messages for xmlrpclib.Faults, matching similar code
in main.py.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 1d0bd5ea2c87 -r 94971fe9c62a tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Thu Mar 30 23:14:09 2006
+++ b/tools/python/xen/xm/create.py     Thu Mar 30 23:15:12 2006
@@ -27,9 +27,11 @@
 import commands
 import time
 import re
+import xmlrpclib
 
 from xen.xend import sxp
 from xen.xend import PrettyPrint
+import xen.xend.XendClient
 from xen.xend.XendClient import server
 from xen.xend.XendBootloader import bootloader
 from xen.util import blkif
@@ -814,6 +816,14 @@
 
     try:
         dominfo = server.xend.domain.create(config)
+    except xmlrpclib.Fault, ex:
+        import signal
+        if vncpid:
+            os.kill(vncpid, signal.SIGKILL)
+        if ex.faultCode == xen.xend.XendClient.ERROR_INVALID_DOMAIN:
+            err("the domain '%s' does not exist." % ex.faultString)
+        else:
+            err("%s" % ex.faultString)
     except Exception, ex:
         import signal
         if vncpid:
@@ -824,6 +834,9 @@
 
     try:
         server.xend.domain.waitForDevices(dom)
+    except xmlrpclib.Fault, ex:
+        server.xend.domain.destroy(dom)
+        err("%s" % ex.faultString)
     except:
         server.xend.domain.destroy(dom)
         err("Device creation failed for domain %s" % dom)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Better formatting of error messages for xmlrpclib.Faults, matching similar code, Xen patchbot -unstable <=