#NEWLINE# @ cpo . event_wrapper ( True , step = _ ( 'Rebalance Topology' ) , param = ( 'cluster' , 1 ) ) #NEWLINE# def rebalance_topology( self , cluster ) : #NEWLINE# #INDENT# topology_names = self . _get_running_topologies_names ( cluster ) #NEWLINE# master = utils . get_instance ( cluster , 'nimbus' ) #NEWLINE# for topology_name in topology_names : #NEWLINE# #INDENT# cmd = ( '%(rebalance)s -c nimbus.host=%(host)s %(topology_name)s' % { #NEWLINE# #INDENT# 'rebalance' : '/usr/local/storm/bin/storm rebalance' , #NEWLINE# 'host' : master . hostname ( ) , #NEWLINE# 'topology_name' : topology_name , #NEWLINE# #UNINDENT# } ) #NEWLINE# with remote . get_remote ( master ) as r : #NEWLINE# #INDENT# ( ret , stdout ) = r . execute_command ( cmd )