guest: Don't ignore invalid boot_order inputs

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

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
This commit is contained in:
Marc Hartmayer 2019-02-06 10:55:43 +01:00 committed by Cole Robinson
parent 1369549aab
commit 8d185f3e4b
1 changed files with 1 additions and 4 deletions

View File

@ -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"""