Running autotest on a OpenSUSE client (12.1), that is
grub-based, I've found that boottool would fail with:
Traceback (most recent call last):
File "/usr/local/autotest/tools/boottool", line 1994, in <module>
app.run()
File "/usr/local/autotest/tools/boottool", line 1804, in run
result = action_method()
File "/usr/local/autotest/tools/boottool", line 1885, in action_info
entries = self.grubby.get_entries()
File "/usr/local/autotest/tools/boottool", line 1010, in get_entries
entries[entry["index"]] = entry
KeyError: 'index'
Turns out that the code is assuming that we can always
parse an index from the raw grubby output, leading to
the above error when the assumption does not hold true.
Fortunately, this is easy to fix, just handle KeyErrors
and continue on to parse the rest of the split parts
of the raw output.
CC: Cleber Rosa <[email protected]>
Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
client/tools/boottool | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/client/tools/boottool b/client/tools/boottool
index d0e8ce0..794377b 100755
--- a/client/tools/boottool
+++ b/client/tools/boottool
@@ -1006,7 +1006,10 @@ class Grubby(object):
if 'non linux entry' in entry_str:
continue
entry = parse_entry("index" + entry_str)
- entries[entry["index"]] = entry
+ try:
+ entries[entry["index"]] = entry
+ except KeyError:
+ continue
return entries
--
1.7.10.2
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest