[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend: fix SyntaxError for Python 2.4 or earlier



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.