Fixed setup_plymouth_splash

The schema generated get_bootsplash_theme() method returns a list
because it's section content. The return value of the method was
used as a string which caused a runtime error
This commit is contained in:
Marcus Schäfer 2017-06-20 18:31:07 +02:00
parent 176c7c547e
commit 431afc847e
No known key found for this signature in database
GPG Key ID: AD11DD02B44996EF
2 changed files with 4 additions and 3 deletions

View File

@ -368,8 +368,9 @@ class SystemSetup(object):
theme_setup = 'plymouth-set-default-theme'
if Path.which(filename=theme_setup, custom_env=chroot_env):
for preferences in self.xml_state.get_preferences_sections():
splash_theme = preferences.get_bootsplash_theme()
if splash_theme:
splash_section_content = preferences.get_bootsplash_theme()
if splash_section_content:
splash_theme = splash_section_content[0]
Command.run(
['chroot', self.root_dir, theme_setup, splash_theme]
)

View File

@ -411,7 +411,7 @@ class TestSystemSetup(object):
mock_which.return_value = 'plymouth-set-default-theme'
preferences = mock.Mock()
preferences.get_bootsplash_theme = mock.Mock(
return_value='some-theme'
return_value=['some-theme']
)
self.xml_state.get_preferences_sections = mock.Mock(
return_value=[preferences]