anaconda/bugfix-Fix-traceback-when-starting-installation-with-inst.c.patch
xuxiaolong 27667a0985 sync 49 fixbug from github
(cherry picked from commit 0cd8608199f6b9726c451e0e9fe3be4a1dbe7cca)
2021-04-27 14:12:18 +08:00

37 lines
1.3 KiB
Diff

From 0f9873a2ffbf3a180a236c4f036e54520773f2ca Mon Sep 17 00:00:00 2001
From: Jiri Konecny <jkonecny@redhat.com>
Date: Tue, 22 Sep 2020 16:28:48 +0200
Subject: [PATCH] Fix traceback when starting installation with inst.console
(no args)
None is the default value which would fail on os.path.basename call.
---
pyanaconda/modules/storage/bootloader/base.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/modules/storage/bootloader/base.py b/pyanaconda/modules/storage/bootloader/base.py
index b1122287a..a8eb26cc7 100644
--- a/pyanaconda/modules/storage/bootloader/base.py
+++ b/pyanaconda/modules/storage/bootloader/base.py
@@ -903,10 +903,16 @@ class BootLoader(object):
def _set_console(self):
""" Set console options based on boot arguments. """
- console = kernel_arguments.get("console", "")
+ console = kernel_arguments.get("console")
+
+ if not console:
+ return
+
console = os.path.basename(console)
self.console, _x, self.console_options = console.partition(",")
+ log.debug("Console is set to %s with options '%s'", self.console, self.console_options)
+
def write_config_console(self, config):
"""Write console-related configuration lines."""
pass
--
2.23.0