qubes/vm: fix parameters for some even handlers
This commit is contained in:
parent
2bb73ab0a1
commit
5e2b617c6f
@ -994,4 +994,4 @@ class Qubes(qubes.PropertyHolder):
|
||||
if vm.provides_network and vm.property_is_default('netvm'):
|
||||
# fire property-del:netvm as it is responsible for resetting
|
||||
# netvm to it's default value
|
||||
vm.fire_event('property-del:netvm', 'netvm', newvalue, oldvalue)
|
||||
vm.fire_event('property-del:netvm', 'netvm', oldvalue)
|
||||
|
@ -180,7 +180,7 @@ class NetVMMixin(qubes.events.Emitter):
|
||||
|
||||
|
||||
@qubes.events.handler('domain-pre-shutdown')
|
||||
def shutdown_net(self, force=False):
|
||||
def shutdown_net(self, event, force=False):
|
||||
connected_vms = [vm for vm in self.connected_vms if vm.is_running()]
|
||||
if connected_vms and not force:
|
||||
raise qubes.exc.QubesVMError(
|
||||
@ -272,7 +272,7 @@ class NetVMMixin(qubes.events.Emitter):
|
||||
pass
|
||||
|
||||
@qubes.events.handler('property-del:netvm')
|
||||
def on_property_del_netvm(self, event, name, old_netvm):
|
||||
def on_property_del_netvm(self, event, prop, old_netvm=None):
|
||||
# pylint: disable=unused-argument
|
||||
# we are changing to default netvm
|
||||
new_netvm = self.netvm
|
||||
|
@ -597,7 +597,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
||||
self.autostart = self.autostart
|
||||
|
||||
@qubes.events.handler('property-pre-set:autostart')
|
||||
def on_property_pre_set_autostart(self, event, prop, name, value,
|
||||
def on_property_pre_set_autostart(self, event, prop, value,
|
||||
oldvalue=None):
|
||||
# pylint: disable=unused-argument
|
||||
if subprocess.call(['sudo', 'systemctl',
|
||||
|
Loading…
Reference in New Issue
Block a user