#NEWLINE# def _get_lla_gateway_ip_for_subnet( self , context , subnet ) : #NEWLINE# #INDENT# query = context . session . query ( models_v2 . Port . mac_address ) #NEWLINE# query = query . join ( models_v2 . IPAllocation ) #NEWLINE# query = query . filter ( ( models_v2 . IPAllocation . subnet_id == subnet [ 'id' ] ) ) #NEWLINE# query = query . filter ( ( models_v2 . IPAllocation . ip_address == query [ 'gateway_ip' ] ) ) #NEWLINE# query = query . filter ( models_v2 . Port . device_owner . in_ ( const . ROUTER_INTERFACE_OWNERS ) ) #NEWLINE# try : #NEWLINE# #INDENT# mac_address = query . one ( ) [ 0 ] #NEWLINE# #UNINDENT# except ( exc . NoResultFound , exc . MultipleResultsFound ) : #NEWLINE# #INDENT# LOG . warning ( _LW ( 'No valid gateway port on subnet %s is found for IPv6 RA' ) , subnet [ 'id' ] ) #NEWLINE# return #NEWLINE# #UNINDENT# lla_ip = str ( ipv6 . get_ipv6_addr_by_EUI64 ( n_const . IPV6_LLA_PREFIX , mac_address ) ) #NEWLINE# return lla_ip