Skip to contentSkip to conversation

KVM test: physical_resources_check: Initialize output

PATCH New Lucas Meneghel Rodrigues 1 participant 1 message Jan 10, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM test: physical_resources_check: Initialize output

So we don't have errors when the monitor function "info" fails, leading to an undefined variable error.

---
 client/tests/kvm/tests/physical_resources_check.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
client/tests/kvm/tests/physical_resources_check.py +3 -0
index b9542b7..54bfbd9 100644
@@ -53,6 +53,7 @@ def run_physical_resources_check(test, params, env):
     def check_num(devices, info_cmd, check_str):
         f_fail = 0
         expected_num = params.objects(devices).__len__()
+        o = ""
         try:
             o = vm.monitor.info(info_cmd)
         except kvm_monitor.MonitorError, e:
@@ -84,6 +85,7 @@ def run_physical_resources_check(test, params, env):
             expected = params.object_params(chk_device).get(fmt_model)
             if not expected:
                 expected = "rtl8139"
+            o = ""
             try:
                 o = vm.monitor.info(info_cmd)
             except kvm_monitor.MonitorError, e:
@@ -115,6 +117,7 @@ def run_physical_resources_check(test, params, env):
     n_fail += f_fail
 
     logging.info("Network card MAC check")
+    o = ""
     try:
         o = vm.monitor.info("network")
     except kvm_monitor.MonitorError, e:
Signature · 1 line
1.7.3.4