Bug 555046 - package uninstall and reinstall do not change package installation date un WebUI
Summary: package uninstall and reinstall do not change package installation date un WebUI
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Registration
Version: 530
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Martin Minar
URL:
Whiteboard:
Depends On:
Blocks: sat540-rpm-inst-date
TreeView+ depends on / blocked
 
Reported: 2010-01-13 14:18 UTC by Jan Hutař
Modified: 2016-07-04 00:54 UTC (History)
6 users (show)

Fixed In Version: spacewalk-backend-1.2.11-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-28 14:46:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Hutař 2010-01-13 14:18:27 UTC
Description of problem:
Package uninstall and reinstall followed by a profile synchronization do not change package installation date in RHN WebUI - for now tested on Spacewalk 0.7.


Version-Release number of selected component (if applicable):
Spacewalk 0.7
rhn-client-tools-0.4.20-14.el5


How reproducible:
always


Steps to Reproduce:
1. # yum -y install zsh
2. # rpm -e zsh
3. # rpm -ivh zsh-4.2.6-3.el5.rpm
4. # rhn-profile-sync


Actual results:
Installation date on the WebUI shows date of point "1."


Expected results:
Should show date of point "3."


Additional info:
If this is desired behavior, CLOSE this request.

Comment 2 Michael Mráka 2010-08-24 12:49:03 UTC
Steps to Reproduce:
1. # yum -y install zsh
2. # rpm -e zsh
3. # rpm -ivh zsh-4.2.6-3.el5.rpm
4. # rhn-profile-sync

Make sure rhn_check (or rhn-profile-sync) doesn't run between steps 2 and 3.

Comment 3 Michael Mráka 2010-08-24 12:59:12 UTC
The bug is in spacewalk-backend code. Client only send list of installed packages with their attributes and it's a servers duty to update its database properly.

server/rhnServer/server_packages.py: line 98

class Packages:
...
    def add_package(self, sysid, entry):
        log_debug(4, sysid, entry)
        p = dbPackage(entry)
        if p is None:
            # Not a valid package spec
            return -1
        if not self.__loaded:
            self.reload_packages_byid(sysid)
        if self.__p.has_key(p.nvrea):                  # <---
            self.__p[p.nvrea].add()
            self.__changed = 1
            return 0
        self.__p[p.nvrea] = p
        self.__changed = 1
        return 0

Because package already exists server ignores changed installtime.


Re-assigning to satellite server component.

Comment 4 Miroslav Suchý 2010-09-08 12:39:41 UTC
When packages have different installtime (and same nvrea) then the package are updated in db (to be precise it is deleted and inserted again).
Commits:
7d9f704010e255ca16bb2eddbc2efcd9a639858c
432e369e5a75a3f6aad346ede5e8d70edfbf9a47

Comment 7 Tomas Lestach 2010-10-22 13:04:52 UTC
I followed the described reproducer and the WebUI shows the correct installation date - when the package was reinstalled.

STAGE VALIDATED on Satellite-5.4.0-RHEL5-re20101015.0.

Comment 8 Clifford Perry 2010-10-28 14:42:26 UTC
The 5.4.0 RHN Satellite and RHN Proxy release has occurred. This issue has been resolved with this release. 


RHEA-2010:0801 - RHN Satellite Server 5.4.0 Upgrade
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10332

RHEA-2010:0803 - RHN Tools enhancement update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10333

RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10334

RHEA-2010:0800 - RHN Satellite Server 5.4.0
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10335

Docs are available:

http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/index.html 

Regards,
Clifford


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