Commit 5ead756 1 parent 1ad66e5 commit 5ead756 Copy full SHA for 5ead756
File tree 1 file changed +17
-7
lines changed
1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -220,8 +220,10 @@ def assign_device(args):
220
220
"""
221
221
vm = args .domains [0 ]
222
222
device = args .device
223
- if args .port :
223
+ if args .only_port :
224
224
device .device_id = None
225
+ if args .only_device :
226
+ device .port = None
225
227
options = dict (opt .split ('=' , 1 ) for opt in args .option or [])
226
228
if args .ro :
227
229
options ['read-only' ] = 'yes'
@@ -453,12 +455,20 @@ def get_parser(device_class=None):
453
455
"be required to the qube's startup and then"
454
456
" automatically attached)" )
455
457
456
- assign_parser .add_argument ('--port' ,
457
- action = 'store_true' ,
458
- default = False ,
459
- help = "Ignore device presented identity and "
460
- "attach any device connected to the given "
461
- "port number" )
458
+ id_parser = assign_parser .add_mutually_exclusive_group ()
459
+ id_parser .add_argument ('--port' ,
460
+ dest = 'only_port' ,
461
+ action = 'store_true' ,
462
+ default = False ,
463
+ help = "Ignore device presented identity and "
464
+ "attach later any device connected "
465
+ "to the given port" )
466
+ id_parser .add_argument ('--device' ,
467
+ dest = 'only_device' ,
468
+ action = 'store_true' ,
469
+ default = False ,
470
+ help = "Ignore current port identity and "
471
+ "attach this device connected to any port" )
462
472
attach_parser .set_defaults (func = attach_device )
463
473
detach_parser .set_defaults (func = detach_device )
464
474
assign_parser .set_defaults (func = assign_device )
You can’t perform that action at this time.
0 commit comments