File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1325,15 +1325,23 @@ def get_address_list() -> typing.List[str]:
1325
1325
else :
1326
1326
valid_func = Validation .valid_ucast_ip
1327
1327
1328
+ if _context .yes_to_all or _context .nic_addr_list :
1329
+ loop_count = len (_context .default_ip_list )
1330
+ else :
1331
+ # interative mode or without -i option specified
1332
+ loop_count = min (Context .MAX_LINK_NUM , len (_context .interfaces_inst .nic_list ))
1333
+
1328
1334
ringXaddr_list = []
1329
- loop_count = min (Context .MAX_LINK_NUM , len (_context .default_ip_list ))
1330
1335
for i in range (loop_count ):
1331
1336
addr = prompt_for_string ("Address for ring{}" .format (i ),
1332
1337
default = pick_default_value (_context .default_ip_list , ringXaddr_list ),
1333
1338
valid_func = valid_func ,
1334
1339
prev_value = ringXaddr_list )
1335
1340
ringXaddr_list .append (addr )
1336
- if i < (loop_count - 1 ) and not confirm ("\n Add another ring?" ):
1341
+ # only confirm when not the last loop and without -i option specified
1342
+ if not _context .nic_addr_list and \
1343
+ i < (loop_count - 1 ) and \
1344
+ not confirm ("\n Add another ring?" ):
1337
1345
break
1338
1346
1339
1347
return ringXaddr_list
You can’t perform that action at this time.
0 commit comments