diff mbox

[KVM-AUTOTEST,1/2] KVM test: make_qemu_command(): properly deal with get_mac_address() failure

Message ID 1298070688-12228-1-git-send-email-mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Feb. 18, 2011, 11:11 p.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 969558b..d852784 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -638,7 +638,10 @@  class VM:
             except IndexError:
                 netdev_id = None
             # Handle the '-net nic' part
-            mac = vm.get_mac_address(vlan)
+            try:
+                mac = vm.get_mac_address(vlan)
+            except VMAddressError:
+                mac = None
             qemu_cmd += add_nic(help, vlan, nic_params.get("nic_model"), mac,
                                 netdev_id, nic_params.get("nic_extra_params"))
             # Handle the '-net tap' or '-net user' part