#NEWLINE# def _refresh_all_commands( ) : #NEWLINE# #INDENT# for ( zk_path , command ) in _PATH_TO_COMMAND . iteritems ( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# if ( command in _COMMAND_TO_NOTIFICATION_TIME ) : #NEWLINE# #INDENT# now = datetime . datetime . now ( ) #NEWLINE# previous_start = _COMMAND_TO_NOTIFICATION_TIME [ command ] #NEWLINE# log . debug ( ( 'Command %s was last started at %s' % ( command , str ( previous_start ) ) ) ) #NEWLINE# duration = ( now - previous_start ) #NEWLINE# if ( duration . seconds <= _CONCURRENT_MIN_WINDOW_IN_SECS ) : #NEWLINE# #INDENT# log . info ( ( 'It is not more %d seconds after command %s was executed, ignore' % ( _CONCURRENT_MIN_WINDOW_IN_SECS , command ) ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# #UNINDENT# log . info ( ( 'It is time to execute the command %s for path %s' % ( command , zk_path ) ) ) #NEWLINE# env = os . environ . copy ( ) #NEWLINE# env [ '__ZK_UPDATE_MONITOR_REFRESH__' ] = 'True' #NEWLINE# _run_command_and_check_ret_code ( command , env , _PATH_TO_ALERT_DISABLED . get ( zk_path , False ) , zk_path = zk_path , downloader_report_metadadata = True ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# log . exception ( 'Refresh commands exception' )