From 37f0641c26be353ee601d04f9f6b25cab3375e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Wed, 5 Aug 2020 15:35:18 +0200 Subject: [PATCH] Added more resilience to missing permissions to utils vm_dependencies function will now no longer throw an exception when encountering rejection for property_is_default method. --- qubesadmin/utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qubesadmin/utils.py b/qubesadmin/utils.py index 2350f46..95a10d5 100644 --- a/qubesadmin/utils.py +++ b/qubesadmin/utils.py @@ -142,8 +142,13 @@ def vm_dependencies(app, reference_vm): if vm == reference_vm: continue for prop in vm_properties: - if reference_vm == getattr(vm, prop, None) and \ - not vm.property_is_default(prop): + if not hasattr(vm, prop): + continue + try: + is_prop_default = vm.property_is_default(prop) + except qubesadmin.exc.QubesPropertyAccessError: + is_prop_default = False + if reference_vm == getattr(vm, prop, None) and not is_prop_default: result.append((vm, prop)) return result