#NEWLINE# def run( self , args ) : #NEWLINE# #INDENT# if ( args . start is not None ) : #NEWLINE# #INDENT# ctx = Context ( is_master = True , master_addr = args . start , working_dir = args . working ) #NEWLINE# ctx . start_master ( ) #NEWLINE# self . logger . info ( ( 'start master at: %s' % ctx . master_addr ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( args . kill is not None ) : #NEWLINE# #INDENT# ctx = Context ( is_client = True , master_addr = args . kill ) #NEWLINE# ctx . kill_master ( ) #NEWLINE# self . logger . info ( ( 'kill master at: %s' % ctx . master_addr ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( args . list is not None ) : #NEWLINE# #INDENT# ctx = Context ( is_client = True , master_addr = args . list ) #NEWLINE# self . logger . info ( ( 'list workers at master: %s' % ctx . master_addr ) ) #NEWLINE# for ( worker , status ) in ctx . list_workers ( ) : #NEWLINE# #INDENT# self . logger . info ( ( '====> worker: %s, status: %s' % ( worker , status ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . logger . error ( 'unknown command options' )