diff --git a/qubes/app.py b/qubes/app.py index f21be915..91a9a97f 100644 --- a/qubes/app.py +++ b/qubes/app.py @@ -1530,9 +1530,7 @@ class Qubes(qubes.PropertyHolder): for vm in self.domains: if hasattr(vm, 'provides_network') and not vm.provides_network and \ hasattr(vm, 'netvm') and vm.property_is_default('netvm'): - # fire property-del:netvm as it is responsible for resetting + # fire property-reset:netvm as it is responsible for resetting # netvm to it's default value - vm.fire_event('property-pre-del:netvm', pre_event=True, - name='netvm', oldvalue=oldvalue) - vm.fire_event('property-del:netvm', + vm.fire_event('property-reset:netvm', name='netvm', oldvalue=oldvalue) diff --git a/qubes/ext/audio.py b/qubes/ext/audio.py index f4b13308..a8108b0b 100644 --- a/qubes/ext/audio.py +++ b/qubes/ext/audio.py @@ -48,9 +48,8 @@ class AUDIO(qubes.ext.Extension): self.on_property_set(vm, event, name='audiovm', newvalue=vm.audiovm) - # property-del <=> property-reset-to-default - @qubes.ext.handler('property-del:audiovm') - def on_property_del(self, subject, event, name, oldvalue=None): + @qubes.ext.handler('property-reset:audiovm') + def on_property_reset(self, subject, event, name, oldvalue=None): newvalue = getattr(subject, 'audiovm', None) self.on_property_set(subject, event, name, newvalue, oldvalue) diff --git a/qubes/ext/core_features.py b/qubes/ext/core_features.py index 4df3da9f..fc799353 100644 --- a/qubes/ext/core_features.py +++ b/qubes/ext/core_features.py @@ -75,8 +75,8 @@ class CoreFeatures(qubes.ext.Extension): # pylint: disable=unused-argument self.set_servicevm_feature(subject) - @qubes.ext.handler('property-del:provides_network') - def on_property_del(self, subject, event, name): + @qubes.ext.handler('property-reset:provides_network') + def on_property_reset(self, subject, event, name): # pylint: disable=unused-argument self.set_servicevm_feature(subject) diff --git a/qubes/ext/gui.py b/qubes/ext/gui.py index dc61e888..9ff81651 100644 --- a/qubes/ext/gui.py +++ b/qubes/ext/gui.py @@ -58,9 +58,8 @@ class GUI(qubes.ext.Extension): if 'guivm-' + vm.guivm.name not in vm.tags: self.on_property_set(vm, event, name='guivm', newvalue=vm.guivm) - # property-del <=> property-reset-to-default - @qubes.ext.handler('property-del:guivm') - def on_property_del(self, subject, event, name, oldvalue=None): + @qubes.ext.handler('property-reset:guivm') + def on_property_reset(self, subject, event, name, oldvalue=None): newvalue = getattr(subject, 'guivm', None) self.on_property_set(subject, event, name, newvalue, oldvalue) diff --git a/qubes/firewall.py b/qubes/firewall.py index 37b6fc99..f16ccdd6 100644 --- a/qubes/firewall.py +++ b/qubes/firewall.py @@ -329,8 +329,8 @@ class Rule(qubes.PropertyHolder): if newvalue not in ('icmp',): self.icmptype = qubes.property.DEFAULT - @qubes.events.handler('property-del:proto') - def on_del_proto(self, event, name, oldvalue): + @qubes.events.handler('property-reset:proto') + def on_reset_proto(self, event, name, oldvalue): # pylint: disable=unused-argument self.dstports = qubes.property.DEFAULT self.icmptype = qubes.property.DEFAULT diff --git a/qubes/vm/appvm.py b/qubes/vm/appvm.py index df69569f..fb7ee016 100644 --- a/qubes/vm/appvm.py +++ b/qubes/vm/appvm.py @@ -112,8 +112,8 @@ class AppVM(qubes.vm.qubesvm.QubesVM): ''' # pylint: disable=unused-argument assert self.template - @qubes.events.handler('property-pre-del:template') - def on_property_pre_del_template(self, event, name, oldvalue=None): + @qubes.events.handler('property-pre-reset:template') + def on_property_pre_reset_template(self, event, name, oldvalue=None): '''Forbid deleting template of running VM ''' # pylint: disable=unused-argument,no-self-use raise qubes.exc.QubesValueError('Cannot unset template') diff --git a/qubes/vm/dispvm.py b/qubes/vm/dispvm.py index da0214c0..a11b14f6 100644 --- a/qubes/vm/dispvm.py +++ b/qubes/vm/dispvm.py @@ -134,7 +134,7 @@ class DispVM(qubes.vm.qubesvm.QubesVM): assert self.template @qubes.events.handler('property-pre-set:template', - 'property-pre-del:template') + 'property-pre-reset:template') def on_property_pre_set_template(self, event, name, newvalue=None, oldvalue=None): ''' Disposable VM cannot have template changed ''' diff --git a/qubes/vm/mix/net.py b/qubes/vm/mix/net.py index a5e3f0e5..313261b0 100644 --- a/qubes/vm/mix/net.py +++ b/qubes/vm/mix/net.py @@ -406,8 +406,8 @@ class NetVMMixin(qubes.events.Emitter): '/connected-ips6', ' '.join(connected_ips6)) - @qubes.events.handler('property-pre-del:netvm') - def on_property_pre_del_netvm(self, event, name, oldvalue=None): + @qubes.events.handler('property-pre-reset:netvm') + def on_property_pre_reset_netvm(self, event, name, oldvalue=None): ''' Sets the the NetVM to default NetVM ''' # pylint: disable=unused-argument # we are changing to default netvm @@ -419,8 +419,8 @@ class NetVMMixin(qubes.events.Emitter): self.fire_event('property-pre-set:netvm', pre_event=True, name='netvm', newvalue=newvalue, oldvalue=oldvalue) - @qubes.events.handler('property-del:netvm') - def on_property_del_netvm(self, event, name, oldvalue=None): + @qubes.events.handler('property-reset:netvm') + def on_property_reset_netvm(self, event, name, oldvalue=None): ''' Sets the the NetVM to default NetVM ''' # pylint: disable=unused-argument # we are changing to default netvm diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index e0b42da9..9fc300b7 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -1006,8 +1006,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): raise qubes.exc.QubesException( 'Failed to set autostart for VM in systemd') - @qubes.events.handler('property-pre-del:autostart') - def on_property_pre_del_autostart(self, event, name, oldvalue=None): + @qubes.events.handler('property-pre-reset:autostart') + def on_property_pre_reset_autostart(self, event, name, oldvalue=None): # pylint: disable=unused-argument if oldvalue: retcode = subprocess.call(