Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions qubeswhonix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"""qubes-core-admin extension for handling Whonix related settings"""

import qubes.ext
import qubes.vm
import qubes.vm.templatevm


Expand Down Expand Up @@ -177,6 +178,8 @@ def on_domain_add(self, app, _event, vm, **_kwargs):
"""Handle new AppVM created on whonix-ws/whonix-gw template and
adjust its default settings
"""
if not isinstance(vm, qubes.vm.LocalVM):
return

if vm.features.check_with_template("whonix-gw", None):
vm.tags.add("anon-gateway")
Expand Down Expand Up @@ -249,6 +252,9 @@ def on_domain_load(self, vm, _event):
"""Retroactively add tags to sys-whonix and anon-whonix. Also enable
event buffering if it's not already enabled.
"""
if not isinstance(vm, qubes.vm.LocalVM):
return

if vm.features.check_with_template("whonix-gw", None):
if "anon-gateway" not in vm.tags:
vm.tags.add("anon-gateway")
Expand Down
2 changes: 2 additions & 0 deletions test-packages/qubes/vm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class LocalVM:
pass