From 3f2eba25742bd40d686f71cd3d6a6b4dca7dabee Mon Sep 17 00:00:00 2001 From: Miguel Di Ciurcio Filho <miguel.filho@gmail.com> Date: Thu, 2 Dec 2010 14:00:09 -0200 Subject: [PATCH] kvm: Make _GetKVMVersion() return integers The current code returns the major, minor and rev portions of the version of KVM as strings. Returning them as integers makes it easier to compare. Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com> Signed-off-by: Guido Trotter <ultrotter@google.com> Reviewed-by: Guido Trotter <ultrotter@google.com> --- lib/hypervisor/hv_kvm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py index 9816b3523..671b8dfd5 100644 --- a/lib/hypervisor/hv_kvm.py +++ b/lib/hypervisor/hv_kvm.py @@ -836,7 +836,9 @@ class KVMHypervisor(hv_base.BaseHypervisor): match = cls._VERSION_RE.search(result.output.splitlines()[0]) if not match: return None - return (match.group(0), match.group(1), match.group(2), match.group(3)) + + return (match.group(0), int(match.group(1)), int(match.group(2)), + int(match.group(3))) def StopInstance(self, instance, force=False, retry=False, name=None): """Stop an instance. -- GitLab