vm/qubesvm: fix handling empty kernel value
Do not fail on empty kernel value - which means "use booloader on
root.img".
Fixes 3ddc052
"vm: move kernel presence validation to event handler"
This commit is contained in:
parent
26013122a0
commit
a6c16d00be
@ -360,6 +360,11 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
|
||||
self.assertPropertyInvalidValue(vm, 'kernel', 123)
|
||||
self.assertPropertyInvalidValue(vm, 'kernel', 'invalid')
|
||||
|
||||
def test_252_kernel_empty(self):
|
||||
vm = self.get_vm()
|
||||
self.assertPropertyValue(vm, 'kernel', '', '', '')
|
||||
self.assertPropertyValue(vm, 'kernel', None, '', '')
|
||||
|
||||
def test_260_kernelopts(self):
|
||||
vm = self.get_vm()
|
||||
self.assertPropertyDefaultValue(vm, 'kernelopts',
|
||||
|
@ -755,6 +755,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
||||
@qubes.events.handler('property-pre-set:kernel')
|
||||
def on_property_pre_set_kernel(self, event, name, newvalue, oldvalue=None):
|
||||
# pylint: disable=unused-argument
|
||||
if not newvalue:
|
||||
return
|
||||
dirname = os.path.join(
|
||||
qubes.config.system_path['qubes_base_dir'],
|
||||
qubes.config.system_path['qubes_kernels_base_dir'],
|
||||
|
Loading…
Reference in New Issue
Block a user