[Libvirt-cim] [PATCH] [TEST] #2 Fix CIM_REV to handle non integer strings
Deepti B Kalakeri
deeptik at linux.vnet.ibm.com
Thu Jun 5 12:35:21 UTC 2008
+1 for me.
Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert <karupert at us.ibm.com>
> # Date 1212165521 25200
> # Node ID 2ab3883ed2a7e9343292abcf765b809c1badcb4d
> # Parent 959719c32cc9d5a60fe3d6474e3fcc09f2e44875
> [TEST] #2 Fix CIM_REV to handle non integer strings.
>
> When working with patches, the changeset revision has a + appended to it.
>
> Update:
> -Changed isalnum() to isdigit() because we expect the revision string to be all digits.
>
> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>
> diff -r 959719c32cc9 -r 2ab3883ed2a7 suites/libvirt-cim/lib/XenKvmLib/const.py
> --- a/suites/libvirt-cim/lib/XenKvmLib/const.py Wed Jun 04 17:30:22 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.isdigit():
> + CIM_REV = int(rev)
> +else:
> + CIM_REV = 0
> CIM_SET = os.getenv("CIM_SET")
>
> if not CIM_REV or not CIM_SET:
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
>
More information about the Libvirt-cim
mailing list