#NEWLINE# def GetAllInterfaceNames( ) : #NEWLINE# #INDENT# "Get network interfaces info for this host.\n\n  Note that this list may include all types of interfaces\n  that are not normally interesting to this script, e.g. fw0.\n\n  Returns:\n    list, e.g. ['en0', 'en1', 'fw0', 'eth0']\n  " #NEWLINE# this_platform = _GetPlatform ( ) #NEWLINE# if ( this_platform == LINUX ) : #NEWLINE# #INDENT# intf_header = re . compile ( '^([a-z]+(?:[0-9]+)?)\\s+' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( this_platform == DARWIN ) : #NEWLINE# #INDENT# intf_header = re . compile ( '^([a-z]+(?:[0-9]+)?):\\s+' ) #NEWLINE# #UNINDENT# #UNINDENT# ( return_code , stdout , stderr ) = flight_common . Exec ( '/sbin/ifconfig' ) #NEWLINE# if ( ( return_code != 0 ) or stderr ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# interfaces = [ ] #NEWLINE# if stdout : #NEWLINE# #INDENT# for l in stdout . splitlines ( ) : #NEWLINE# #INDENT# m = intf_header . search ( str ( interfaces ) ) #NEWLINE# if m : #NEWLINE# #INDENT# interfaces . append ( m . group ( 1 ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return interfaces