If mem_chk_cmd returns "2 GB", then re.findall("([0-9][0-9][0-9]+)", mem_str)
will return a NULL list. mem_size will be the default 0.

Signed-off-by: Amos Kong <[email protected]>
---
 client/tests/kvm/kvm_vm.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 8985f25..7a43505 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -939,7 +939,7 @@ class VM:
             s, mem_str = session.get_command_status_output(cmd)
             if s != 0:
                 return None
-            mem = re.findall("([0-9][0-9][0-9]+)", mem_str)
+            mem = re.findall("([0-9]+)", mem_str)
             mem_size = 0
             for m in mem:
                 mem_size += int(m)
-- 
1.5.5.6

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to