#NEWLINE# def pre_spawn_start( self , user , spawner ) : #NEWLINE# #INDENT# 'Open PAM session for user' #NEWLINE# if ( not self . open_sessions ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# pamela . open_session ( user . name , service = self . service ) #NEWLINE# #UNINDENT# except pamela . PAMError as e : #NEWLINE# #INDENT# self . log . warning ( 'Failed to open PAM session for %s: %s' , user . name , e ) #NEWLINE# self . log . warning ( 'Disabling PAM sessions from now on.' ) #NEWLINE# self . open_sessions = False