PackageProvidesCommand - Command /bin/echo {command_package}

class insights.parsers.package_provides.PackageProvidesCommand(context, extra_bad_lines=None)[source]

Bases: CommandParser, dict

Parser to parse the specified running commands and its provider packages.

This parser will receive a list of string pairs which is generated by several @datasource and functions. The first string is the full path of the specified running command and the second string is the package that provides this command. It works as a dict with the command as the key and the corresponding package name as the value.

To check the provider package of the specified command, please add the command to the COMMANDS of insights.specs.default.DefaultSpecs.cmd_and_pkg()

Sample output:

/usr/bin/java java-11-openjdk-11.0.9.11-2.el8_3.x86_64
/usr/sbin/httpd httpd-2.4.22-7.el7.x86_64
/usr/lib/jvm/jre/bin/java java-1.8.0-openjdk-1.8.0.272.b10-3.el8_3.x86_64
/opt/rh/httpd24/root/usr/sbin/httpd httpd24-httpd-2.4.34-7.el7.x86_64
Raises:

Example

>>> '/usr/lib/jvm/jre/bin/java' in cmd_package.commands
True
>>> 'java-11-openjdk-11.0.9.11-2.el8_3.x86_64' in cmd_package.packages
True
>>> '/usr/sbin/httpd' in cmd_package.commands
True
>>> 'httpd24-httpd-2.4.34-7.el7.x86_64' in cmd_package.packages
True
>>> cmd_package['/usr/lib/jvm/jre/bin/java']
'java-1.8.0-openjdk-1.8.0.272.b10-3.el8_3.x86_64'
>>> cmd_package['/usr/sbin/httpd']
'httpd-2.4.22-7.el7.x86_64'
property commands

Returns the list of specified commands that are running on this host.

property packages

Returns the list of the packages that provide the specified commands.

parse_content(content)[source]

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