#NEWLINE# @ classmethod #NEWLINE# def _get_interface_info( cls , device_id , network_id , external = False ) : #NEWLINE# #INDENT# if ( cls . _device_network_interface_map is None ) : #NEWLINE# #INDENT# cls . _get_network_interface_map_from_config ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# dev_info = cls . _device_network_interface_map [ device_id ] #NEWLINE# if external : #NEWLINE# #INDENT# return dev_info [ 'external' ] . get ( network_id , dev_info [ 'external' ] [ '*' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return dev_info [ 'internal' ] . get ( network_id , cls [ 'internal' ] [ '*' ] ) #NEWLINE# #UNINDENT# #UNINDENT# except ( TypeError , KeyError ) : #NEWLINE# #INDENT# LOG . error ( _LE ( 'Failed to lookup interface on device %(dev)sfor network %(net)s' ) , { #NEWLINE# #INDENT# 'dev' : device_id , #NEWLINE# 'net' : network_id , #NEWLINE# #UNINDENT# } ) #NEWLINE# return