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-3.4-testing] Fix domain exit actions that contain h

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] Fix domain exit actions that contain hyphen
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 09 Mar 2010 10:25:23 -0800
Delivery-date: Tue, 09 Mar 2010 10:25:48 -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 1268157929 0
# Node ID 14704aeaeec80d246c448bd4668a4ed2b02f181c
# Parent  6063c16aeeaa85bed0b34606e11a0e939384a754
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>
xen-unstable changeset:   20995:6c338a5830b5
xen-unstable date:        Wed Mar 03 17:40:22 2010 +0000
---
 tools/python/xen/xm/xenapi_create.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r 6063c16aeeaa -r 14704aeaeec8 tools/python/xen/xm/xenapi_create.py
--- a/tools/python/xen/xm/xenapi_create.py      Tue Mar 02 19:22:22 2010 +0000
+++ b/tools/python/xen/xm/xenapi_create.py      Tue Mar 09 18:05:29 2010 +0000
@@ -624,11 +624,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)
             else:
-                return val
+                return lval
 
         actions_after_shutdown = conv_chk(actions_after_shutdown,\
                                           XEN_API_ON_NORMAL_EXIT)

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

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