tools: improve --all switch

Don't check VM 'qid' (which require mgmt call), but VM class instead
This commit is contained in:
Marek Marczykowski-Górecki 2017-04-15 14:57:30 +02:00
parent 7a4f36f015
commit 21c65d7ea8
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -33,6 +33,7 @@ import textwrap
import qubesmgmt.log import qubesmgmt.log
import qubesmgmt.exc import qubesmgmt.exc
import qubesmgmt.vm
#: constant returned when some action should be performed on all qubes #: constant returned when some action should be performed on all qubes
VM_ALL = object() VM_ALL = object()
@ -142,7 +143,8 @@ class VmNameAction(QubesAction):
namespace.domains = [ namespace.domains = [
vm vm
for vm in app.domains for vm in app.domains
if vm.qid != 0 and vm.name not in namespace.exclude if not isinstance(vm, qubesmgmt.vm.AdminVM) and
vm.name not in namespace.exclude
] ]
else: else:
if hasattr(namespace, 'exclude') and namespace.exclude: if hasattr(namespace, 'exclude') and namespace.exclude: