#NEWLINE# def task_update_status( self , uuid , statuses , status_value ) : #NEWLINE# #INDENT# session = get_session ( ) #NEWLINE# query = session . query ( models . Task ) . filter ( ( models . Task . uuid == uuid ) , models . Task . status . in_ ( statuses ) ) . update ( { #NEWLINE# #INDENT# 'status' : status_value , #NEWLINE# #UNINDENT# } , synchronize_session = False ) #NEWLINE# if ( not query ) : #NEWLINE# #INDENT# status = ' or ' . join ( statuses ) #NEWLINE# msg = ( _ ( "Task with uuid='%(uuid)s' and in statuses:'%(statuses)s' not found.'" ) % { #NEWLINE# #INDENT# 'uuid' : uuid , #NEWLINE# 'statuses' : status , #NEWLINE# #UNINDENT# } ) #NEWLINE# raise exceptions . RallyException ( msg ) #NEWLINE# #UNINDENT# return query