[master 1/1] decode package name for /etc/sysconfig/kernel (RHBZ #1261569)

AdamWill installerbot-noreply at redhat.com
Thu Oct 15 05:10:27 UTC 2015


From: Adam Williamson <awilliam at redhat.com>

Seems in Python 3 when we get a package name from RPM in this
way it comes out as a bytestring, we need a regular string as
we're going to write it into a text file. Without this fix
/etc/sysconfig/kernel gets a line:

DEFAULTKERNEL=b'kernel-core'

which obviously isn't what we wanted, and means new kernels
sometimes don't get set as the default boot option.
---
 pyanaconda/bootloader.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index ff3279b..68131ff 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -2345,7 +2345,7 @@ def writeSysconfigKernel(storage, version, instClass):
         log.error("failed to get package name for default kernel")
         return
 
-    kernel = h.name
+    kernel = h.name.decode()
 
     f = open(iutil.getSysroot() + "/etc/sysconfig/kernel", "w+")
     f.write("# UPDATEDEFAULT specifies if new-kernel-pkg should make\n"


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/7da0acfac0cc74d6556ed42b513f875fa89465b4


More information about the anaconda-patches mailing list