#NEWLINE# def _patch_proxy_pipeline_line( orig_line , storlet_middleware ) : #NEWLINE# #INDENT# mds = list ( ) #NEWLINE# for md in orig_line . split ( ) : #NEWLINE# #INDENT# if ( ( md == 'pipeline' ) or ( md == '=' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# mds . append ( md ) #NEWLINE# #UNINDENT# if ( storlet_middleware in mds ) : #NEWLINE# #INDENT# return orig_line #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# slo_index = mds . index ( 'slo' ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# slo_index = ( - 1 ) #NEWLINE# #UNINDENT# if ( slo_index != ( - 1 ) ) : #NEWLINE# #INDENT# mds . insert ( slo_index , storlet_middleware ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# proxy_index = mds . index ( 'proxy-server' ) #NEWLINE# mds . insert ( proxy_index , storlet_middleware ) #NEWLINE# #UNINDENT# new_line = 'pipeline =' #NEWLINE# for md in mds : #NEWLINE# #INDENT# new_line += ( ' ' + md ) #NEWLINE# #UNINDENT# return ( orig_line + '\n' )