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] xend: fix SyntaxError for Python 2.4 or e

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: fix SyntaxError for Python 2.4 or earlier
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 30 Jul 2010 01:45:20 -0700
Delivery-date: Fri, 30 Jul 2010 01:46:09 -0700
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 Kuwamura Shin'ya <kuwa@xxxxxxxxxxxxxx>
# Date 1280418047 -3600
# Node ID 4a4d9e3ca3ef08c19bb54628d2cc5f394f9ce44e
# Parent  3477b170e9cbc33294a299455a37ee71bd38b4c8
xend: fix SyntaxError for Python 2.4 or earlier

21866:e017930af272 causes SyntaxError on Python 2.4 or earlier, since
the syntax "true_value if condition else false_value" was introduced
by Python 2.5.

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendConfig.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -r 3477b170e9cb -r 4a4d9e3ca3ef tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Thu Jul 29 16:12:50 2010 +0100
+++ b/tools/python/xen/xend/XendConfig.py       Thu Jul 29 16:40:47 2010 +0100
@@ -65,8 +65,10 @@ def bool0(v):
 
 def convert_on_crash(v):
     v = str(v)
-    return XEN_API_ON_CRASH_BEHAVIOUR_LEGACY[v] \
-            if v in XEN_API_ON_CRASH_BEHAVIOUR else v
+    if v in XEN_API_ON_CRASH_BEHAVIOUR:
+        return XEN_API_ON_CRASH_BEHAVIOUR_LEGACY[v]
+    else:
+        return v
 
 # Recursively copy a data struct, scrubbing out VNC passwords.
 # Will scrub any dict entry with a key of 'vncpasswd' or any

_______________________________________________
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] xend: fix SyntaxError for Python 2.4 or earlier, Xen patchbot-unstable <=