Bug 469825 - package-cleanup --oldkernels fails if running kernel has no '-' in its name
package-cleanup --oldkernels fails if running kernel has no '-' in its name
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: yum-utils (Show other bugs)
10
All Linux
medium Severity medium
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-04 05:13 EST by Zdenek Kabelac
Modified: 2014-01-21 18:06 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-03-05 10:42:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Zdenek Kabelac 2008-11-04 05:13:44 EST
Description of problem:

package-cleanup gives this error message:
Traceback (most recent call last):
  File "/usr/bin/package-cleanup", line 451, in <module>
    main()
  File "/usr/bin/package-cleanup", line 419, in main
    removeKernels(my, opts.kernelcount, opts.confirmed, opts.keepdevel)
  File "/usr/bin/package-cleanup", line 314, in removeKernels
    (kver,krel) = runningkernel.split('-')

If my running kernel is without any '-' in its name - i.e. when I run clean 2.6.27 kernel which is not packages by fedora.

I've fixed this by using this small patch thought I'm surely not a pythonist ;)


--- /tmp/package-cleanup	2008-11-04 11:06:36.000000000 +0100
+++ /usr/bin/package-cleanup	2008-11-04 11:07:14.000000000 +0100
@@ -311,8 +311,13 @@
         sys.exit(100)
     kernels = getKernels(my)
     runningkernel = os.uname()[2]
-    (kver,krel) = runningkernel.split('-')
-    
+
+    if runningkernel.find('-') != -1:
+        (kver,krel) = runningkernel.split('-')
+    else
+         kver=runningkernel
+         krel=""
+
     remove = kernels[count:]
     toremove = []




Version-Release number of selected component (if applicable):
yum-utils-1.1.17-2.fc10.noarch

How reproducible:


Steps to Reproduce:
1. boot kernel linus git kernel 2.6.27
2. run package-cleanup --oldkernels
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Bug Zapper 2008-11-25 23:43:56 EST
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

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