#NEWLINE# def _normalize_test_json( self , val ) : #NEWLINE# #INDENT# def __replace_port_name( k , v ) : #NEWLINE# #INDENT# for port_name in [ 'target_recv_port' , 'target_send_port_1' , 'target_send_port_2' , 'tester_send_port' , 'tester_recv_port_1' , 'tester_recv_port_2' ] : #NEWLINE# #INDENT# if ( v [ k ] == port_name ) : #NEWLINE# #INDENT# v [ k ] = CONF [ 'test-switch' ] [ port_name ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if isinstance ( val , dict ) : #NEWLINE# #INDENT# for ( k , v ) in val . items ( ) : #NEWLINE# #INDENT# if ( k == 'OFPActionOutput' ) : #NEWLINE# #INDENT# if ( 'port' in v ) : #NEWLINE# #INDENT# __replace_port_name ( 'port' , v ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( k == 'OXMTlv' ) : #NEWLINE# #INDENT# if ( v . get ( 'field' , '' ) == 'in_port' ) : #NEWLINE# #INDENT# __replace_port_name ( 'value' , k ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . _normalize_test_json ( v ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( val , list ) : #NEWLINE# #INDENT# for v in val : #NEWLINE# #INDENT# self . _normalize_test_json ( v )