Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-24433

dnf versionlock delete wipes commented lines from /etc/dnf/plugins/versionlock.list

    • Icon: Bug Bug
    • Resolution: Can't Do
    • Icon: Minor Minor
    • None
    • rhel-8.9.0
    • dnf-plugins-core
    • None
    • Low
    • rhel-sst-cs-software-management
    • ssg_core_services
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      dnf versionlock comments added by the plugin (containing versionlock timestamp) are valued for compliance reasons.

      dnf versionlock delete [package] wipes all commented lines from /etc/dnf/plugins/versionlock.list

      Please provide the package NVR for which bug is seen:

      python3-dnf-plugin-versionlock-4.0.21-19.el8_8.noarch

      How reproducible:

      add versionlock for multiple packages and delete versionlock for some package;

      Steps to reproduce

       
      [root@fastvm-rhel-8-8-188 ~]# rpm -q python3-dnf-plugin-versionlock
      python3-dnf-plugin-versionlock-4.0.21-19.el8_8.noarch
      [root@fastvm-rhel-8-8-188 ~]# dnf versionlock add openssh-clients
      Updating Subscription Management repositories.
      Last metadata expiration check: 0:52:12 ago on Tue 06 Feb 2024 11:56:07 AM CET.
      Adding versionlock on: openssh-clients-0:8.0p1-6.el8_4.2.*
      [root@fastvm-rhel-8-8-188 ~]# cat /etc/dnf/plugins/versionlock.list
      # Added lock on Tue Feb 6 12:48:23 2024
      openssh-clients-0:8.0p1-6.el8_4.2.*
      [root@fastvm-rhel-8-8-188 ~]# dnf versionlock add openssh-server
      Updating Subscription Management repositories.
      Last metadata expiration check: 0:52:40 ago on Tue 06 Feb 2024 11:56:07 AM CET.
      Adding versionlock on: openssh-server-0:8.0p1-6.el8_4.2.*
      [root@fastvm-rhel-8-8-188 ~]# cat /etc/dnf/plugins/versionlock.list
      # Added lock on Tue Feb 6 12:48:23 2024
      openssh-clients-0:8.0p1-6.el8_4.2.*
      
      # Added lock on Tue Feb 6 12:48:51 2024
      openssh-server-0:8.0p1-6.el8_4.2.*
      [root@fastvm-rhel-8-8-188 ~]# dnf versionlock delete openssh-server
      Updating Subscription Management repositories.
      Last metadata expiration check: 0:53:01 ago on Tue 06 Feb 2024 11:56:07 AM CET.
      Deleting versionlock for: openssh-server-0:8.0p1-6.el8_4.2.*
      [root@fastvm-rhel-8-8-188 ~]# cat /etc/dnf/plugins/versionlock.list
      openssh-clients-0:8.0p1-6.el8_4.2.*
       

      Expected results

      dnf versionlock delete [package] should remove only plugin generated comment line related to the package(s) specified for versionlock delete (only 1 commented line above each of the package(s) specified (starting with "# Added lock") in case such a line exist in /etc/dnf/plugins/versionlock.list)

      Actual results

      dnf versionlock delete wipes all comments from /etc/dnf/plugins/versionlock.list

              Unassigned Unassigned
              rhn-support-dbodnarc Dmitri Bodnarciuc
              packaging-team-maint packaging-team-maint
              Software Management QE Software Management QE
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: