#NEWLINE# def _SaveAuthentication( self ) : #NEWLINE# #INDENT# 'Save the authorization cookie to a local file.' #NEWLINE# auth_file = self . _AuthFilePath ( ) #NEWLINE# try : #NEWLINE# #INDENT# dir = os . path . dirname ( auth_file ) #NEWLINE# if ( not os . path . exists ( dir ) ) : #NEWLINE# #INDENT# os . makedirs ( dir ) #NEWLINE# #UNINDENT# fh = open ( auth_file , 'w' ) #NEWLINE# fh . write ( self . _user_cookie ) #NEWLINE# fh . close ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# logging . fatal ( 'Failed to save authorization file %s' , self , exc_info = True ) #NEWLINE# raise ScenarioLoginError ( ( 'Error saving auth file for client %s.' % self . name ) )