Skip to content

pkg.installed and zypperpkg.py do not recognize installed patterns #52402

@aplanas

Description

@aplanas

Description of Issue/Question

In zypper (openSUSE) we can install other kind of objects similar to packages. Currently we recognize package, patch, pattern and product. Eventually all of them are resolved to a set of packages.

In zypper we can specify the type using the --type parameter or a prefix before the package name. For example, those two sentences are equivalent:

zypper install --type pattern SUSE-MicroOS
zypper install pattern:SUSE-MicroOS

We can now use the salt state pkg.installed to install packages and patterns:

example:
  pkg.installed:
    - name: pattern:SUSE-MicroOS

The problem is that pkg.installed and zypperpkg.list_pkgs do not recognize patters, and the rpm query do not return them, breaking the logic to identify if the package needs to be installed and to signalize the installation as a success or fail.

Setup

Any SaltStack version will be OK, on top of any SUSE / openSUSE variant.

Steps to Reproduce Issue

We can reproduce the issue installing any pattern, for example:

salt-call -l debug state.single pkg.installed name=pattern:SUSE-MicroOS

If the pattern is not installed, it will be correctly installed but the state will fail, as is not able to validate the installation. If the pattern is already present, it will try to reinstall again (as is not able to identify the pattern as already installed), and will fail again in the detection, making the state failing.

Versions Report

Any version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Featurenew functionality including changes to functionality and code refactors, etc.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions