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

[master] Do not report patches as installed when not all the related pkgs are installed (yumpkg) #55582

Conversation

meaksh
Copy link
Contributor

@meaksh meaksh commented Dec 10, 2019

This PR ports #52657 to master branch, and fixes an issue at 2019.2.x release.


What does this PR do?

This PR fixes an issue in the _get_patches function from the yumpkg module which affects the output from pkg.list_patches method on yum based systems. Currently, this function is reporting that a given patch is "installed" even when not all its related packages are actually installed on the system.

The _get_patches function from yumpkg parses the output from yum --quiet updateinfo list all command in order to figure out which patches are "available/installed". But there is a problem when this output is handled so the resulting dictionary is setting any patch as "installed" as soon as one of its related packages is installed. The right behavior here would be to set a patch as "installed" only if all its related packages are installed.

Previous Behavior

An example with a patch named suse-res7ct-client-tools-201705-13137:

[root@suma40-min-centos7 ~]# yum --quiet updateinfo list all | grep 13137
Failed to set locale, defaulting to C
  suse-res7ct-client-tools-201705-13137 recommended    osa-common-5.11.80.2-24.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    osad-5.11.80.2-24.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    python-hwdata-2.3.4-9.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    rhn-custom-info-5.4.33.2-12.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    rhn-virtualization-common-5.4.57.1-15.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    rhn-virtualization-host-5.4.57.1-15.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    rhncfg-5.10.103.2-15.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    rhncfg-actions-5.10.103.2-15.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    rhncfg-client-5.10.103.2-15.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    rhncfg-management-5.10.103.2-15.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    rhnlib-2.7.2.1-21.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    rhnpush-5.5.104.1-15.4.noarch
  suse-res7ct-client-tools-201705-13137 recommended    spacecmd-2.7.8.3-32.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    spacewalk-abrt-2.7.1.2-12.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    spacewalk-backend-libs-2.7.73.3-49.2.noarch
i suse-res7ct-client-tools-201705-13137 recommended    spacewalk-check-2.7.6.2-48.2.noarch
i suse-res7ct-client-tools-201705-13137 recommended    spacewalk-client-setup-2.7.6.2-48.2.noarch
i suse-res7ct-client-tools-201705-13137 recommended    spacewalk-client-tools-2.7.6.2-48.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    spacewalk-koan-2.7.0.2-18.2.noarch
i suse-res7ct-client-tools-201705-13137 recommended    spacewalk-oscap-2.7.0.3-12.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    spacewalk-remote-utils-2.7.4.1-15.2.noarch
i suse-res7ct-client-tools-201705-13137 recommended    spacewalk-usix-2.7.5.2-2.2.noarch
  suse-res7ct-client-tools-201705-13137 recommended    spacewalksd-5.0.26.2-21.2.x86_64
i suse-res7ct-client-tools-201705-13137 recommended    suseRegisterInfo-3.1.1-18.2.x86_64
i suse-res7ct-client-tools-201705-13137 recommended    yum-rhn-plugin-2.7.4.2-21.2.noarch

[root@suma40-min-centos7 ~]# salt-call --local pkg.list_patches
...
    suse-res7ct-client-tools-201705-13137:
        ----------
        installed:
            True
        summary:
            yum-rhn-plugin-2.7.4.2-21.2.noarch
...

New Behavior

[root@suma40-min-centos7 ~]# salt-call --local pkg.list_patches
...
    suse-res7ct-client-tools-201705-13137:
        ----------
        installed:
            False
        summary:
            - osa-common-5.11.80.2-24.2.noarch
            - osad-5.11.80.2-24.2.noarch
            - python-hwdata-2.3.4-9.2.noarch
            - rhn-custom-info-5.4.33.2-12.2.noarch
            - rhn-virtualization-common-5.4.57.1-15.2.noarch
            - rhn-virtualization-host-5.4.57.1-15.2.noarch
            - rhncfg-5.10.103.2-15.2.noarch
            - rhncfg-actions-5.10.103.2-15.2.noarch
            - rhncfg-client-5.10.103.2-15.2.noarch
            - rhncfg-management-5.10.103.2-15.2.noarch
            - rhnlib-2.7.2.1-21.2.noarch
            - rhnpush-5.5.104.1-15.4.noarch
            - spacecmd-2.7.8.3-32.2.noarch
            - spacewalk-abrt-2.7.1.2-12.2.noarch
            - spacewalk-backend-libs-2.7.73.3-49.2.noarch
            - spacewalk-check-2.7.6.2-48.2.noarch
            - spacewalk-client-setup-2.7.6.2-48.2.noarch
            - spacewalk-client-tools-2.7.6.2-48.2.noarch
            - spacewalk-koan-2.7.0.2-18.2.noarch
            - spacewalk-oscap-2.7.0.3-12.2.noarch
            - spacewalk-remote-utils-2.7.4.1-15.2.noarch
            - spacewalk-usix-2.7.5.2-2.2.noarch
            - spacewalksd-5.0.26.2-21.2.x86_64
            - suseRegisterInfo-3.1.1-18.2.x86_64
            - yum-rhn-plugin-2.7.4.2-21.2.noarch
...

Tests written?

No

Commits signed with GPG?

Yes

@waynew
Copy link
Contributor

waynew commented Jan 2, 2020

I've merged the latest master into your branch - there were a bunch of the same test failures on several different branches, but they didn't seem related to this PR so I'm guessing that they got fixed in the most recent master.

@waynew
Copy link
Contributor

waynew commented Jan 7, 2020

There was one failure here: https://jenkinsci.saltstack.com/job/pr-windows2016-py3/job/PR-55582/7/ but that didn't look related.

I went ahead and merged master in again 🤞

@dwoz dwoz merged commit 8d52ccd into saltstack:master Jan 11, 2020
@meaksh meaksh deleted the master-yumpkg-do-not-report-uninstalled-patches-as-installed branch January 13, 2020 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants