vm: fix calling vm.detach_network() when really needed
*oldvalue* argument to property event handler is provided only when the value was not default. Check vm.netvm directly to resolve also default.
This commit is contained in:
parent
92a460526f
commit
173e7e4250
@ -412,7 +412,8 @@ class NetVMMixin(qubes.events.Emitter):
|
||||
'Cannot dynamically attach to stopped NetVM: {!r}'.format(
|
||||
newvalue))
|
||||
|
||||
if oldvalue is not None:
|
||||
# don't check oldvalue, because it's missing if it was default
|
||||
if self.netvm is not None:
|
||||
if self.is_running():
|
||||
self.detach_network()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user