Skip to content

Commit

Permalink
Added more resilience to missing permissions to utils
Browse files Browse the repository at this point in the history
vm_dependencies function will now no longer throw an exception
when encountering rejection for property_is_default method.
  • Loading branch information
marmarta committed Aug 5, 2020
1 parent a078e1f commit 37f0641
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions qubesadmin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37f0641

Please sign in to comment.