[PATCH virt-manager 10/10] guest: Don't ignore invalid boot_order inputs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A `KeyError` indicates that the `boot_order` input was
invalid. Therefore we shouldn't ignore this error silently.

Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
---
 virtinst/guest.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/virtinst/guest.py b/virtinst/guest.py
index 0ea99d3343da..46d27daca6e8 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -384,10 +384,7 @@ class Guest(XMLBuilder):
         dev_map = dict((dev.get_xml_id(), dev) for dev in
                        self.get_bootable_devices())
         for boot_idx, dev_xml_id in enumerate(boot_order, 1):
-            try:
-                dev_map[dev_xml_id].boot.order = boot_idx
-            except KeyError:
-                pass
+            dev_map[dev_xml_id].boot.order = boot_idx
 
     def set_boot_order(self, boot_order, legacy=False):
         """Modifies the boot order"""
-- 
2.17.0

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux