#NEWLINE# def update_vm_result( self , context , msg ) : #NEWLINE# #INDENT# "Update VM's result field in the DB.\n\n        The result reflects the success of failure of operation when an\n        agent processes the vm info.\n        " #NEWLINE# args = jsonutils . loads ( msg ) #NEWLINE# agent = context . get ( 'agent' ) #NEWLINE# port_id = args . get ( 'port_uuid' ) #NEWLINE# result = args . get ( 'result' ) #NEWLINE# LOG . debug ( 'update_vm_result received from %(agent)s: %(port_id)s %(result)s' , { #NEWLINE# #INDENT# 'agent' : agent , #NEWLINE# 'port_id' : port_id , #NEWLINE# 'result' : result , #NEWLINE# #UNINDENT# } ) #NEWLINE# event_type = 'agent.vm_result.update' #NEWLINE# payload = { #NEWLINE# #INDENT# 'port_id' : port_id , #NEWLINE# 'result' : result , #NEWLINE# #UNINDENT# } #NEWLINE# timestamp = time . ctime ( ) #NEWLINE# data = ( event_type , payload ) #NEWLINE# pri = ( self . obj . PRI_LOW_START + 10 ) #NEWLINE# self . obj . pqueue . put ( ( pri , timestamp , data ) ) #NEWLINE# LOG . debug ( 'Added request vm result update into queue.' ) #NEWLINE# return 0