@@ -63,12 +63,13 @@ def prepare_table(dev_list):
63
63
return header + sorted (output )
64
64
65
65
66
- class Line ( object ) :
66
+ class Line :
67
67
"""Helper class to hold single device info for listing"""
68
68
69
69
# pylint: disable=too-few-public-methods
70
70
def __init__ (self , device : DeviceInfo , attached_to = None ):
71
- self .ident = "{!s}:{!s}" .format (device .backend_domain , device .port_id ) # TODO!
71
+ self .ident = "{!s}:{!s}" .format (
72
+ device .backend_domain , device .port_id )
72
73
self .description = device .description
73
74
self .attached_to = attached_to if attached_to else ""
74
75
self .frontends = []
@@ -151,11 +152,14 @@ def _frontend_desc(vm, assignment):
151
152
"""
152
153
Generate description of frontend vm with optional device connection options.
153
154
"""
155
+ mode = assignment .mode .value
156
+ if mode == 'manual' :
157
+ mode = 'attached'
154
158
if assignment .options :
155
- return '{!s} ({})' .format (
156
- vm , ', ' .join ('{}={}' .format (key , value )
159
+ return '{!s} ({}: {} )' .format (
160
+ vm , mode , ', ' .join ('{}={}' .format (key , value )
157
161
for key , value in assignment .options .items ()))
158
- return str ( vm )
162
+ return f' { vm } ( { mode } )'
159
163
160
164
161
165
def attach_device (args ):
0 commit comments