@@ -243,18 +243,26 @@ def update_parser_network(self, parser):
243243 parser .add_argument (
244244 '--network' ,
245245 metavar = '<network>' ,
246+ dest = 'networks' ,
247+ action = 'append' ,
246248 help = self .enhance_help_neutron (
247249 _ (
248- "List floating IP(s) according to "
249- "given network (name or ID)"
250+ "List floating IP(s) according to given network "
251+ "(name or ID) "
252+ "(repeat option to fiter on multiple networks)"
250253 )
251254 ),
252255 )
253256 parser .add_argument (
254257 '--port' ,
255258 metavar = '<port>' ,
259+ dest = 'ports' ,
260+ action = 'append' ,
256261 help = self .enhance_help_neutron (
257- _ ("List floating IP(s) according to given port (name or ID)" )
262+ _ (
263+ "List floating IP(s) according to given port (name or ID) "
264+ "(repeat option to fiter on multiple ports)"
265+ )
258266 ),
259267 )
260268 parser .add_argument (
@@ -271,14 +279,6 @@ def update_parser_network(self, parser):
271279 _ ("List floating IP(s) according to given floating IP address" )
272280 ),
273281 )
274- parser .add_argument (
275- '--long' ,
276- action = 'store_true' ,
277- default = False ,
278- help = self .enhance_help_neutron (
279- _ ("List additional fields in output" )
280- ),
281- )
282282 parser .add_argument (
283283 '--status' ,
284284 metavar = '<status>' ,
@@ -295,22 +295,36 @@ def update_parser_network(self, parser):
295295 metavar = '<project>' ,
296296 help = self .enhance_help_neutron (
297297 _ (
298- "List floating IP(s) according to given project (name or "
299- "ID)"
298+ "List floating IP(s) according to given project "
299+ "(name or ID) "
300300 )
301301 ),
302302 )
303303 identity_common .add_project_domain_option_to_parser (parser )
304304 parser .add_argument (
305305 '--router' ,
306306 metavar = '<router>' ,
307+ dest = 'routers' ,
308+ action = 'append' ,
307309 help = self .enhance_help_neutron (
308- _ ("List floating IP(s) according to given router (name or ID)" )
310+ _ (
311+ "List floating IP(s) according to given router "
312+ "(name or ID) "
313+ "(repeat option to fiter on multiple routers)"
314+ )
309315 ),
310316 )
311317 _tag .add_tag_filtering_option_to_parser (
312318 parser , _ ('floating IP' ), enhance_help = self .enhance_help_neutron
313319 )
320+ parser .add_argument (
321+ '--long' ,
322+ action = 'store_true' ,
323+ default = False ,
324+ help = self .enhance_help_neutron (
325+ _ ("List additional fields in output" )
326+ ),
327+ )
314328
315329 return parser
316330
@@ -354,34 +368,49 @@ def take_action_network(self, client, parsed_args):
354368
355369 query = {}
356370
357- if parsed_args .network is not None :
358- network = network_client .find_network (
359- parsed_args .network , ignore_missing = False
360- )
361- query ['floating_network_id' ] = network .id
362- if parsed_args .port is not None :
363- port = network_client .find_port (
364- parsed_args .port , ignore_missing = False
365- )
366- query ['port_id' ] = port .id
371+ if parsed_args .networks is not None :
372+ network_ids = []
373+ for network in parsed_args .networks :
374+ network_id = network_client .find_network (
375+ network , ignore_missing = False
376+ ).id
377+ network_ids .append (network_id )
378+ query ['floating_network_id' ] = network_ids
379+
380+ if parsed_args .ports is not None :
381+ port_ids = []
382+ for port in parsed_args .ports :
383+ port_id = network_client .find_port (
384+ port , ignore_missing = False
385+ ).id
386+ port_ids .append (port_id )
387+ query ['port_id' ] = port_ids
388+
367389 if parsed_args .fixed_ip_address is not None :
368390 query ['fixed_ip_address' ] = parsed_args .fixed_ip_address
391+
369392 if parsed_args .floating_ip_address is not None :
370393 query ['floating_ip_address' ] = parsed_args .floating_ip_address
394+
371395 if parsed_args .status :
372396 query ['status' ] = parsed_args .status
397+
373398 if parsed_args .project is not None :
374399 project = identity_common .find_project (
375400 identity_client ,
376401 parsed_args .project ,
377402 parsed_args .project_domain ,
378403 )
379404 query ['project_id' ] = project .id
380- if parsed_args .router is not None :
381- router = network_client .find_router (
382- parsed_args .router , ignore_missing = False
383- )
384- query ['router_id' ] = router .id
405+
406+ if parsed_args .routers is not None :
407+ router_ids = []
408+ for router in parsed_args .routers :
409+ router_id = network_client .find_router (
410+ router , ignore_missing = False
411+ ).id
412+ router_ids .append (router_id )
413+ query ['router_id' ] = router_ids
385414
386415 _tag .get_tag_filtering_args (parsed_args , query )
387416
0 commit comments