#NEWLINE# def update_endtime( jid , time ) : #NEWLINE# #INDENT# '\n    Update (or store) the end time for a given job\n\n    Endtime is stored as a plain text string\n    ' #NEWLINE# jid_dir = _jid_dir ( jid ) #NEWLINE# try : #NEWLINE# #INDENT# if ( not os . path . exists ( jid_dir ) ) : #NEWLINE# #INDENT# os . makedirs ( jid_dir ) #NEWLINE# #UNINDENT# with salt . utils . fopen ( os . path . join ( jid_dir , ENDTIME ) , 'w' ) as etfile : #NEWLINE# #INDENT# etfile . write ( time ) #NEWLINE# #UNINDENT# #UNINDENT# except IOError as exc : #NEWLINE# #INDENT# log . warning ( 'Could not write job invocation cache file: {0}' . format ( exc ) )