#NEWLINE# @ gen . coroutine #NEWLINE# def check_routes( self , user_dict , routes = None ) : #NEWLINE# #INDENT# 'Check that all users are properly routed on the proxy' #NEWLINE# if ( not routes ) : #NEWLINE# #INDENT# routes = ( yield self . get_routes ( ) ) #NEWLINE# #UNINDENT# have_routes = { r [ 'user' ] for r in routes . values ( ) if ( 'user' in r ) } #NEWLINE# futures = [ ] #NEWLINE# db = inspect ( self ) . session #NEWLINE# for orm_user in db . query ( User ) . filter ( ( User . server != None ) ) : #NEWLINE# #INDENT# user = user_dict [ orm_user ] #NEWLINE# if ( not user . running ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( user . server is None ) : #NEWLINE# #INDENT# self . log . error ( "User %s has no server, but wasn't filtered out." , user ) #NEWLINE# continue #NEWLINE# #UNINDENT# if ( user . name not in have_routes ) : #NEWLINE# #INDENT# self . log . warning ( 'Adding missing route for %s (%s)' , user_dict . name , user . server ) #NEWLINE# futures . append ( self . add_user ( user ) ) #NEWLINE# #UNINDENT# #UNINDENT# for f in futures : #NEWLINE# #INDENT# ( yield f )