#NEWLINE# def _pool_list( request , expand_subnet = False , expand_vip = False , **kwargs ) : #NEWLINE# #INDENT# pools = neutronclient ( request ) . list_pools ( ** kwargs ) . get ( 'pools' ) #NEWLINE# if expand_subnet : #NEWLINE# #INDENT# subnets = neutron . subnet_list ( request ) #NEWLINE# subnet_dict = SortedDict ( ( ( s . id , s ) for s in subnets ) ) #NEWLINE# for p in pools : #NEWLINE# #INDENT# subnet = subnet_dict . get ( p [ 'subnet_id' ] ) #NEWLINE# p [ 'subnet_name' ] = ( subnet . cidr if subnet else None ) #NEWLINE# #UNINDENT# #UNINDENT# if expand_vip : #NEWLINE# #INDENT# vips = vip_list ( request ) #NEWLINE# vip_dict = SortedDict ( ( ( v . id , v ) for v in vips ) ) #NEWLINE# for p in pools : #NEWLINE# #INDENT# p [ 'vip_name' ] = _get_vip ( request , p , vip_dict , expand_name_only = True ) #NEWLINE# #UNINDENT# #UNINDENT# return [ Pool ( p ) for p in pools ]