#NEWLINE# @ user_method #NEWLINE# def rerun_job( self , job_id ) : #NEWLINE# #INDENT# job = NAMESPACE . session . query ( Job ) . get ( job_id ) #NEWLINE# if ( not self ) : #NEWLINE# #INDENT# raise ValueError ( ( 'No job with id %s.' % job_id ) ) #NEWLINE# #UNINDENT# if any ( job . built_binaries ) : #NEWLINE# #INDENT# raise ValueError ( 'Can not re-run a successfull build job.' ) #NEWLINE# #UNINDENT# versions = NAMESPACE . session . query ( Source . version ) . filter ( ( Source . group_suite == job . source . group_suite ) , ( Source . name == job . source . name ) ) #NEWLINE# max_version = max ( [ x [ 0 ] for x in versions ] , key = Version ) #NEWLINE# if ( job . source . version != max_version ) : #NEWLINE# #INDENT# raise ValueError ( 'Can not re-run a job for a superseeded source.' ) #NEWLINE# #UNINDENT# job . failed = None #NEWLINE# job . builder = None #NEWLINE# job . assigned_at = None #NEWLINE# job . finished_at = None #NEWLINE# return job . debilize ( )