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/
Home Products Support Community News


[Xen-changelog] [xen-unstable] Fix domain exit actions that contain hyph

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix domain exit actions that contain hyphen
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 03 Mar 2010 09:45:16 -0800
Delivery-date: Wed, 03 Mar 2010 09:45:14 -0800
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1267638022 0
# Node ID 6c338a5830b524a17290285fd02fa442927b1d52
# Parent  71af69a9d393aaefb22e90342aa0a0cf86aabe53
Fix domain exit actions that contain hyphen

Domain exit actions that contain a hyphen (e.g. rename-restart) were
not being detected properly when xm is configured to use xenapi.
Domain config containing on_crash=3D"rename-restart" results in

xen53:~ # xm new /tmp/domU.config
Using config file "/tmp/domU.config".
Unexpected error: <type 'exceptions.TypeError'>

This patch fixes the raised exception and at the same time
handles the replacement of hyphen with underscore properly.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>
 tools/python/xen/xm/xenapi_create.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r 71af69a9d393 -r 6c338a5830b5 tools/python/xen/xm/xenapi_create.py
--- a/tools/python/xen/xm/xenapi_create.py      Wed Mar 03 17:39:22 2010 +0000
+++ b/tools/python/xen/xm/xenapi_create.py      Wed Mar 03 17:40:22 2010 +0000
@@ -664,11 +664,11 @@ class sxp2xml:
             = get_child_by_name(config, "on_crash", "restart")
         def conv_chk(val, vals):
-            val.replace("-", "_")
-            if val not in vals:
-                raise "Invalid value: " + val
+            lval = val.replace("-", "_")
+            if lval not in vals:
+                raise ValueError("Invalid value: %s" % val)
-                return val
+                return lval
         actions_after_shutdown = conv_chk(actions_after_shutdown,\

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix domain exit actions that contain hyphen, Xen patchbot-unstable <=