#NEWLINE# def cmd_show_devices( ns , device_names = None ) : #NEWLINE# #INDENT# "\n    Implementation of 'net show devices' command.\n    " #NEWLINE# for device in list_devices ( ns , device_names ) : #NEWLINE# #INDENT# ( yield fcmd . NewTableCommand ( title = ( 'Device %s' % device . ElementName ) ) ) #NEWLINE# ( yield ( 'Operating Status' , ns . LMI_IPNetworkConnection . OperatingStatusValues . value_name ( device . OperatingStatus ) ) ) #NEWLINE# ( yield ( 'MAC Address' , get_mac ( ns , device ) ) ) #NEWLINE# for ( ip , prefix ) in get_ipv4_addresses ( ns , device ) : #NEWLINE# #INDENT# ( yield ( 'IPv4 Address' , ( '%s/%s' % ( ip , prefix ) ) ) ) #NEWLINE# #UNINDENT# for ( ip , mask ) in get_ipv6_addresses ( ns , device ) : #NEWLINE# #INDENT# ( yield ( 'IPv6 Address' , ( '%s/%s' % ( ip , mask ) ) ) ) #NEWLINE# #UNINDENT# for gw in get_default_gateways ( ns , device ) : #NEWLINE# #INDENT# ( yield ( 'Default Gateway' , gw ) ) #NEWLINE# #UNINDENT# for dns in get_dns_servers ( ns , device ) : #NEWLINE# #INDENT# ( yield ( 'DNS Server' , dns ) ) #NEWLINE# #UNINDENT# for setting in get_active_settings ( ns , device ) : #NEWLINE# #INDENT# ( yield ( 'Active Setting' , setting . Caption ) ) #NEWLINE# #UNINDENT# for setting in get_available_settings ( ns , device ) : #NEWLINE# #INDENT# ( yield ( 'Available Setting' , setting . Caption ) )