#NEWLINE# def get_subnets_by_net_id( self , context , project_id , net_id ) : #NEWLINE# #INDENT# 'Returns information about the IPv4 and IPv6 subnets\n           associated with a Quantum Network UUID.\n        ' #NEWLINE# subnet_v4 = None #NEWLINE# subnet_v6 = None #NEWLINE# tenant_id = ( project_id or FLAGS . quantum_default_tenant_id ) #NEWLINE# all_blocks = self . m_conn . get_blocks ( tenant_id ) #NEWLINE# for b in all_blocks [ 'ip_blocks' ] : #NEWLINE# #INDENT# if ( b [ 'network_id' ] == net_id ) : #NEWLINE# #INDENT# subnet = { #NEWLINE# #INDENT# 'network_id' : b [ 'network_id' ] , #NEWLINE# 'cidr' : b [ 'cidr' ] , #NEWLINE# 'gateway' : b [ 'gateway' ] , #NEWLINE# 'broadcast' : b [ 'broadcast' ] , #NEWLINE# 'netmask' : b [ 'netmask' ] , #NEWLINE# 'dns1' : b [ 'dns1' ] , #NEWLINE# 'dns2' : b [ 'dns2' ] , #NEWLINE# #UNINDENT# } #NEWLINE# if ( IPNetwork ( b [ 'cidr' ] ) . version == 6 ) : #NEWLINE# #INDENT# subnet_v6 = subnet #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# subnet_v4 = subnet #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ( subnet_v4 , subnet_v6 )