#NEWLINE# def stress( self , stress_options = None , capture_output = False , whitelist = False , **kwargs ) : #NEWLINE# #INDENT# if ( stress_options is None ) : #NEWLINE# #INDENT# stress_options = [ ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# stress_options = stress_options [ : ] #NEWLINE# #UNINDENT# stress = common . get_stress_bin ( self . get_install_dir ( ) ) #NEWLINE# if ( self . cluster . cassandra_version ( ) <= '2.1' ) : #NEWLINE# #INDENT# stress_options . append ( '-d' ) #NEWLINE# stress_options . append ( self . address ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# stress_options . append ( '-node' ) #NEWLINE# if whitelist : #NEWLINE# #INDENT# stress_options . append ( 'whitelist' ) #NEWLINE# #UNINDENT# stress_options . append ( self . address ( ) ) #NEWLINE# if ( not [ opt for opt in stress_options if opt . startswith ( 'jmx=' ) ] ) : #NEWLINE# #INDENT# stress_options . extend ( [ '-port' , ( 'jmx=' + self . jmx_port ) ] ) #NEWLINE# #UNINDENT# #UNINDENT# args = ( [ stress ] + stress_options ) #NEWLINE# try : #NEWLINE# #INDENT# if capture_output : #NEWLINE# #INDENT# p = subprocess . Popen ( args , cwd = common . parse_path ( stress ) , stdout = subprocess . PIPE , stderr = subprocess . PIPE , ** kwargs ) #NEWLINE# ( stdout , stderr ) = p . communicate ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# p = subprocess . Popen ( self , cwd = common . parse_path ( stress ) , ** kwargs ) #NEWLINE# ( stdout , stderr ) = ( None , None ) #NEWLINE# #UNINDENT# p . wait ( ) #NEWLINE# return ( stdout , stderr ) #NEWLINE# #UNINDENT# except KeyboardInterrupt : #NEWLINE# #INDENT# pass