Bug 1785563 - When using versionlock with -q option ALL outputs are dismissed
Summary: When using versionlock with -q option ALL outputs are dismissed
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf-plugins-core
Version: 8.2
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: 8.0
Assignee: nsella
QA Contact: Jan Blazek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-20 09:19 UTC by Marek Blaha
Modified: 2020-07-01 13:43 UTC (History)
3 users (show)

Fixed In Version: dnf-plugins-core-4.0.15-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.