zypper facts

class reemote.facts.zypper.get_packages.Get_packages[source]

Bases: object

Returns a dictionary of installed packages.

Examples:

yield Get_packages()
reemote.facts.zypper.get_packages.parse_rpm_list_installed(output)[source]

Parses the raw string output of rpm -qa into a structured list.

This function processes the multiline string returned by the rpm -qa command, which lists all installed RPM packages. It intelligently separates each line into a package name and its corresponding version string.

The parsing logic is designed to handle package names that may contain hyphens by identifying the version string, which typically starts just before the architecture part of the full package identifier.

Parameters:

output (str) – The raw stdout from the rpm -qa command.

Returns:

A list of dictionaries, where each dictionary

represents an installed package and contains ‘name’ and ‘version’ keys.

Return type:

list[dict]