Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Jul 16, 2024
1 parent 1334d7a commit 12ef850
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions qubesadmin/tools/qvm_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ def list_devices(args):
for dev in result:
for vm in app.domains:
frontends = _load_frontends_info(vm, dev, args.devclass)
if frontends is not None:
result[dev].frontends.append(frontends)
result[dev].frontends.extend(frontends)

qubesadmin.tools.print_table(prepare_table(result.values()))

Expand Down Expand Up @@ -132,19 +131,20 @@ def _load_frontends_info(vm, dev, devclass):
Returns string of vms to which a device is connected or `None`.
"""
if vm == dev.backend_domain:
return None
return

try:
for assignment in vm.devices[devclass].get_dedicated_devices():
if dev != assignment:
return None
continue

Check warning on line 139 in qubesadmin/tools/qvm_device.py

View check run for this annotation

Codecov / codecov/patch

qubesadmin/tools/qvm_device.py#L139

Added line #L139 was not covered by tests
if assignment.options:
return '{!s} ({})'.format(
yield '{!s} ({})'.format(

Check warning on line 141 in qubesadmin/tools/qvm_device.py

View check run for this annotation

Codecov / codecov/patch

qubesadmin/tools/qvm_device.py#L141

Added line #L141 was not covered by tests
vm, ', '.join('{}={}'.format(key, value)
for key, value in assignment.options.items()))
return str(vm)
else:
yield str(vm)
except qubesadmin.exc.QubesVMNotFoundError:
return None
pass

Check warning on line 147 in qubesadmin/tools/qvm_device.py

View check run for this annotation

Codecov / codecov/patch

qubesadmin/tools/qvm_device.py#L147

Added line #L147 was not covered by tests


def attach_device(args):
Expand Down

0 comments on commit 12ef850

Please sign in to comment.