Bug 329651

Summary: package-cleanup --oldkernels : results in error
Product: [Fedora] Fedora Reporter: J Robinson <jrobinson852>
Component: yum-utilsAssignee: Seth Vidal <skvidal>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 6CC: pmatilai, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.1.8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-07 04:44:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description J Robinson 2007-10-12 16:21:51 UTC
Description of problem:

package-cleanup --oldkernels
gave an error message when trying to remove an old kernel

Version-Release number of selected component (if applicable):
yum-3.0.6-1.fc6 
yum-utils-1.0.3-1.fc6 
rpm-4.4.2.1-1.fc6


How reproducible:

Try to remove old kernel kernel-2.6.22.5-49.fc6
 using package-cleanup --oldkernels

Steps to Reproduce:
1. install the latest FC6 kernel, and have kernel-2.6.22.5-49.fc6 already installed
2. run package-cleanup --oldkernels
3. answer Y to "I will remove the following 1 kernel related packages: //
kernel-2.6.22.5-49.fc6 // Is this ok [y/N]"
  
Actual results:
# package-cleanup --oldkernels
Setting up yum
I will remove the following 1 kernel related packages:
kernel-2.6.22.5-49.fc6
Is this ok [y/N]: y
/usr/bin/package-cleanup:312: DeprecationWarning: returnHeaderByTuple() will go
away in a future version of Yum.

  hdr = my.rpmdb.returnHeaderByTuple(kernel)[0]
Traceback (most recent call last):
  File "/usr/bin/package-cleanup", line 402, in ?
    main()
  File "/usr/bin/package-cleanup", line 371, in main
    removeKernels(my, opts.kernelcount, opts.confirmed, opts.keepdevel)
  File "/usr/bin/package-cleanup", line 317, in removeKernels
    my.populateTs()
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 171, in populateTs
    self.ts.addErase(txmbr.po.idx)
AttributeError: 'YumInstalledPackage' object has no attribute 'idx'

Expected results:

old kernel to be removed, as if I did an 'rpm -ev kernel-2.6.22.5-49.fc6'

Additional info:
machine was running Fedora Core 6 with 2.6.22.7-57.fc6
and packages listed above. Machine also reports that all packages are uptodate
via 'yum update'

Comment 1 J Robinson 2007-10-12 16:35:12 UTC
bug duplicated on second FC6 machine, also fully updated

Comment 2 Seth Vidal 2007-12-07 04:44:38 UTC
this has been fixed in yum-utils 1.1.8 and above and released in f7 and f8.