Rpm -V Packages Parsers - command /bin/rpm -V <packages>

Parsers provided in this module includes:

RpmVPackages - command /bin/rpm -V <packages>

RpmVPackage - command /bin/rpm -V <package>

class insights.parsers.rpm_v_packages.RpmVPackage(context, extra_bad_lines=None)[source]

Bases: CommandParser

Class for parsing /bin/rpm -V <package> command.

package_name

The name of package

Type:

String

discrepancies

Every dictionary contains information about one entry

Type:

list of dictionaries

Sample output of this command is:

..?......  c /etc/sudoers
..?......    /usr/bin/sudo
..?......    /usr/bin/sudoreplay
missing     /var/db/sudo/lectured (Permission denied)

Examples

>>> type(rpm_v_pkg)
<class 'insights.parsers.rpm_v_packages.RpmVPackage'>
>>> rpm_v_pkg.package_name
'sudo'
>>> len(rpm_v_pkg.discrepancies)
4
>>> sorted(rpm_v_pkg.discrepancies[0].items())
[('attributes', '..?......'), ('file', '/etc/sudoers'), ('line', '..?......  c /etc/sudoers'), ('mark', 'c')]
parse_content(content)[source]

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

class insights.parsers.rpm_v_packages.RpmVPackages(*args, **kwargs)[source]

Bases: CommandParser

Class for parsing /bin/rpm -V <packages> command.

Warning

This class is deprecated and will be removed from 3.5.0.

For Insights Advisor Rules, it’s recommended to use the insights.parsers.rpm_v_packages.RpmVPackage and add the 'coreutils', 'procps', 'procps-ng', 'shadow-utils', 'passwd', 'sudo', 'chrony', 'findutils', 'glibc' to the filter list of Specs.rpm_V_package_list instead.

packages_list

every dictionary contains information about one entry

Type:

list of dictionaries

Sample output of this command is:

package procps is not installed
..?......  c /etc/sudoers
..?......    /usr/bin/sudo
..?......    /usr/bin/sudoreplay
missing     /var/db/sudo/lectured (Permission denied)

Examples

>>> type(rpm_v_packages)
<class 'insights.parsers.rpm_v_packages.RpmVPackages'>
>>> len(rpm_v_packages.packages_list)
5
>>> sorted(rpm_v_packages.packages_list[0].items())
[('attributes', None), ('file', None), ('line', 'package procps is not installed'), ('mark', None)]
>>> sorted(rpm_v_packages.packages_list[1].items())
[('attributes', '..?......'), ('file', '/etc/sudoers'), ('line', '..?......  c /etc/sudoers'), ('mark', 'c')]
parse_content(content)[source]

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