Bug 1785563

Summary: When using versionlock with -q option ALL outputs are dismissed
Product: Red Hat Enterprise Linux 8 Reporter: Marek Blaha <mblaha>
Component: dnf-plugins-coreAssignee: Nicola Sella <nsella>
Status: CLOSED ERRATA QA Contact: Jan Blazek <jblazek>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.2CC: amatej, james.antill, pkratoch
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-plugins-core-4.0.15-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:52:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marek Blaha 2019-12-20 09:19:04 UTC
Description of problem:

I'm currently working on an Ansible module for yum/dnf versionlock.

I found a bug related to the dnf '-q' option (quiet).
When using this option with versionlock, ALL outputs are dismissed. You even miss the add/exclude/delete actions.
Samples

[root@5a94f6a929cb ~]# dnf -q versionlock add python
[root@5a94f6a929cb ~]# dnf -q versionlock list
[root@5a94f6a929cb ~]# dnf versionlock list
Last metadata expiration check: 1 day, 22:05:15 ago on Wed 18 Dec 2019 05:01:04 AM UTC.
python-0:2.7.5-86.el7.*
[root@5a94f6a929cb ~]# dnf -q versionlock exclude python
[root@5a94f6a929cb ~]# dnf -q versionlock exclude python
[root@5a94f6a929cb ~]# dnf versionlock list
Last metadata expiration check: 1 day, 22:05:39 ago on Wed 18 Dec 2019 05:01:04 AM UTC.
python-0:2.7.5-86.el7.*
!python-0:2.7.5-86.el7.*
!python-0:2.7.5-86.el7.*
[root@5a94f6a929cb ~]# dnf -q versionlock delete python
[root@5a94f6a929cb ~]# dnf versionlock list
Last metadata expiration check: 1 day, 22:05:49 ago on Wed 18 Dec 2019 05:01:04 AM UTC.

Yum's plugin is working fine with the '-q' option and the duplicate entries

[root@5a94f6a929cb ~]# yum -q versionlock add python
Adding versionlock on: 0:python-2.7.5-86.el7
[root@5a94f6a929cb ~]# yum -q versionlock list
0:python-2.7.5-86.el7.*
[root@5a94f6a929cb ~]# yum -q versionlock exclude python
Adding exclude on: 0:python-2.7.5-86.el7
[root@5a94f6a929cb ~]# yum -q versionlock exclude python
[root@5a94f6a929cb ~]# yum -q versionlock list
0:python-2.7.5-86.el7.*
!0:python-2.7.5-86.el7.*
[root@5a94f6a929cb ~]# yum -q versionlock delete python
Deleting versionlock for: 0:python-2.7.5-86.el7.*
Deleting versionlock for: !0:python-2.7.5-86.el7.*
[root@5a94f6a929cb ~]# yum -q versionlock list
[root@5a94f6a929cb ~]#



Version-Release number of selected component (if applicable):

Tested with: in a Centos 7.7 docker image with:

    dnf-4.0.9.2-1.el7_6.noarch
    python2-dnf-plugin-versionlock-4.0.2.2-3.el7_6.noarch
    yum-3.4.3-163.el7.centos.noarch
    yum-plugin-versionlock-1.1.31-52.el7.noar


Additional info:

Filed based on https://github.com/rpm-software-management/dnf-plugins-core/pull/376#issuecomment-567769123

Comment 10 errata-xmlrpc 2020-11-04 01:52:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (yum bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:4510