#NEWLINE# @ staticmethod #NEWLINE# def _extract_subnets( network ) : #NEWLINE# #INDENT# 'Returns information about the IPv4 and IPv6 subnets\n           associated with a Neutron Network UUID.\n        ' #NEWLINE# subnet_v4 = { #NEWLINE# #INDENT# 'network_id' : network . uuid , #NEWLINE# 'cidr' : network . cidr , #NEWLINE# 'gateway' : network . gateway , #NEWLINE# 'dhcp_server' : getattr ( network , 'dhcp_server' ) , #NEWLINE# 'broadcast' : network . broadcast , #NEWLINE# 'netmask' : network . netmask , #NEWLINE# 'version' : 4 , #NEWLINE# 'dns1' : network . dns1 , #NEWLINE# 'dns2' : network . dns2 , #NEWLINE# #UNINDENT# } #NEWLINE# subnet_v6 = { #NEWLINE# #INDENT# 'network_id' : network . uuid , #NEWLINE# 'cidr' : network . cidr_v6 , #NEWLINE# 'gateway' : network . gateway_v6 , #NEWLINE# 'dhcp_server' : None , #NEWLINE# 'broadcast' : None , #NEWLINE# 'netmask' : network . netmask_v6 , #NEWLINE# 'version' : 6 , #NEWLINE# 'dns1' : None , #NEWLINE# 'dns2' : None , #NEWLINE# #UNINDENT# } #NEWLINE# def ips_to_strs( net ) : #NEWLINE# #INDENT# for ( key , value ) in net . items ( ) : #NEWLINE# #INDENT# if isinstance ( value , netaddr . ip . BaseIP ) : #NEWLINE# #INDENT# net [ key ] = str ( value ) #NEWLINE# #UNINDENT# #UNINDENT# return net #NEWLINE# #UNINDENT# return [ ips_to_strs ( subnet_v4 ) , ips_to_strs ( subnet_v6 ) ]