Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #4421/bbe231e2 backport][stable-4] Bugfix: zypper issue with specified package versions #4446

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Apr 5, 2022

This is a backport of PR #4421 as merged into main (bbe231e).

zypper.py was doing nothing on state=present, when ALL requestet/checked packages had a specific version stated. This was caused by get_installed_state() being called with an empty package list, which in this case returns information about all ALL installed packages. This lead to an exessive filter list prerun_state, essentially removing all packages that are installed in ANY version on the target system from the request list.

SUMMARY

I added an empty check to prevent get_installed_state() being called with an empty package list.

Fixes ##4371

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

zypper

ADDITIONAL INFORMATION

The following task ALWAYS reported [ok] if ANY version of a-very-important-package was already installed on the target system.

    - name: Install a specific package version via zypper
      zypper:
        name:
          - "a-very-important-package=2.1"
        state: present
        oldpackage : yes

As soon as at least ONE other package WITHOUT a version specification was requestet, everything worked as expected.

    - name: Install a specific package version via zypper
      zypper:
        name:
          - "a-very-important-package=2.1"
          - "another-package"
        state: present
        oldpackage : yes

after my fix, that workaroud is not necessary and both of the above work as expected

* fixed issue with specified package versions

zypper.py was doing nothing on state=present, when ALL requestet/checked packages had a specific version stated. This was caused by get_installed_state() being called with an empty package list, which in this case returns information about all ALL installed packages. This lead to an exessive filter list prerun_state, essentially removing all packages that are installed in ANY version on the target system from the request list.

* Create 4421-zypper_package_version_handling_fix

added changelog fragment for #4421

* Delete 4421-zypper_package_version_handling_fix

* Create 4421-zypper_package_version_handling_fix.yml

(cherry picked from commit bbe231e)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor os packaging plugins plugin (any type) labels Apr 5, 2022
@felixfontein felixfontein merged commit f0df50e into stable-4 Apr 5, 2022
@felixfontein felixfontein deleted the patchback/backports/stable-4/bbe231e2612a081c8c8489ba4c0c5554f2e06bda/pr-4421 branch April 5, 2022 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor os packaging plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants