Grubby - command /usr/sbin/grubby

This is a collection of parsers that all deal with the command grubby. Parsers included in this module are:

GrubbyDefaultIndex - command grubby --default-index

GrubbyInfoAll - command grubby --info=ALL

class insights.parsers.grubby.GrubbyDefaultIndex(context, extra_bad_lines=None)[source]

Bases: CommandParser

This parser parses the output of command grubby --default-index.

The typical output of this command is:

0

Examples

>>> grubby_default_index.default_index
0
Raises:
default_index

the numeric index of the current default boot entry, count from 0

Type:

int

error_lines

the error messages from the grubby command

Type:

list

parse_content(content)[source]

This method must be implemented by classes based on this class.

class insights.parsers.grubby.GrubbyInfoAll(context, extra_bad_lines=None)[source]

Bases: CommandParser

This parser parses the output of command grubby --info=ALL.

boot_entries

All boot entries indexed by the entry “index”

Type:

dict

unparsed_lines

All the unparsable lines

Type:

list

The typical output of this command is:

index=0
kernel="/boot/vmlinuz-5.14.0-162.6.1.el9_1.x86_64"
args="ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet retbleed=stuff"
root="/dev/mapper/rhel-root"
initrd="/boot/initramfs-5.14.0-162.6.1.el9_1.x86_64.img"
title="Red Hat Enterprise Linux (5.14.0-162.6.1.el9_1.x86_64) 9.1 (Plow)"
id="4d684a4a6166439a867e701ded4f7e10-5.14.0-162.6.1.el9_1.x86_64"
index=1
kernel="/boot/vmlinuz-5.14.0-70.13.1.el9_0.x86_64"
args="ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet retbleed=stuff"
root="/dev/mapper/rhel-root"
initrd="/boot/initramfs-5.14.0-70.13.1.el9_0.x86_64.img"
title="Red Hat Enterprise Linux (5.14.0-70.13.1.el9_0.x86_64) 9.0 (Plow)"
id="4d684a4a6166439a867e701ded4f7e10-5.14.0-70.13.1.el9_0.x86_64"

Examples

>>> len(grubby_info_all.boot_entries)
2
>>> grubby_info_all.boot_entries[0]["kernel"]
'/boot/vmlinuz-5.14.0-162.6.1.el9_1.x86_64'
>>> grubby_info_all.boot_entries[1].get("args").get("rd.lvm.lv")
['rhel/root', 'rhel/swap']
Raises:
parse_content(content)[source]

This method must be implemented by classes based on this class.