tools/qvm-device: list attach options

This commit is contained in:
Marek Marczykowski-Górecki 2017-08-09 04:03:47 +02:00
parent 430ff342d4
commit 414be0945d
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -99,9 +99,15 @@ def list_devices(args):
if domain == dev.backend_domain:
continue
if dev in domain.devices[args.devclass].assignments():
result[dev].frontends.append(str(domain))
for assignment in domain.devices[args.devclass].assignments():
if dev != assignment:
continue
if assignment.options:
result[dev].frontends.append('{!s} ({})'.format(
domain, ', '.join('{}={}'.format(key, value)
for key, value in assignment.options.items())))
else:
result[dev].frontends.append(str(domain))
qubesadmin.tools.print_table(prepare_table(result.values()))