From d85e0899e39697ddbc96b95fd60abc22cff82709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= Date: Tue, 4 Apr 2017 11:18:01 +0200 Subject: [PATCH] Fixup bootloader menu title setup If the menu title is setup via the displayname attribute in the XML configuration, kiwi should not change this text by a prefix or any other style adaptions. Fixes #287 Fixes (bsc#1032118) --- kiwi/bootloader/config/base.py | 5 +++++ test/unit/bootloader_config_base_test.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/kiwi/bootloader/config/base.py b/kiwi/bootloader/config/base.py index 3e0925f2..9801bbfa 100644 --- a/kiwi/bootloader/config/base.py +++ b/kiwi/bootloader/config/base.py @@ -337,6 +337,11 @@ class BootLoaderConfigBase(object): title = self.xml_state.xml_data.get_displayname() if not title: title = self.xml_state.xml_data.get_name() + else: + # if the is set via the displayname attribute no custom + # kiwi prefix or other style changes to that text should + # be made + plain = True type_name = self.xml_state.build_type.get_image() if plain: return title diff --git a/test/unit/bootloader_config_base_test.py b/test/unit/bootloader_config_base_test.py index d8e99e94..f6b26ee2 100644 --- a/test/unit/bootloader_config_base_test.py +++ b/test/unit/bootloader_config_base_test.py @@ -225,6 +225,12 @@ class TestBootLoaderConfigBase(object): assert self.bootloader.get_menu_entry_title(plain=True) == \ 'LimeJeOS-openSUSE-13.2' + @patch('kiwi.xml_parse.image.get_displayname') + def test_get_menu_entry_title_by_displayname(self, mock_displayname): + mock_displayname.return_value = 'my_title' + assert self.bootloader.get_menu_entry_title() == \ + 'my_title' + @patch('kiwi.xml_parse.image.get_displayname') def test_get_menu_entry_install_title(self, mock_displayname): mock_displayname.return_value = None