[Libvirt-cim] [PATCH] [TEST] Fix CIM_REV to handle non integer strings

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Sat May 31 00:48:50 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1212165521 25200
# Node ID 7e4310cd6913605148b038b46d244ed670730727
# Parent  4a5a44d7b857df543af24d59380cb8fdbbb753a4
[TEST] Fix CIM_REV to handle non integer strings.

When working with patches, the changeset revision has a + appended to it.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r 4a5a44d7b857 -r 7e4310cd6913 suites/libvirt-cim/lib/XenKvmLib/const.py
--- a/suites/libvirt-cim/lib/XenKvmLib/const.py	Fri May 30 14:26:38 2008 +0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/const.py	Fri May 30 09:38:41 2008 -0700
@@ -26,7 +26,11 @@
 global CIM_REV
 global CIM_SET
 
-CIM_REV = int(os.getenv("CIM_REV"))
+rev = os.getenv("CIM_REV").strip("+")
+if rev.isalnum():
+    CIM_REV = int(rev)
+else:
+    CIM_REV = 0
 CIM_SET = os.getenv("CIM_SET")
 
 if not CIM_REV or not CIM_SET:




More information about the Libvirt-cim mailing list