def _send_instance_update_notification(context, instance, old_vm_state=None, old_task_state=None, new_vm_state=None, new_task_state=None, service='compute', host=None):
 payload = info_from_instance(context, instance, None, None)
 if (not new_vm_state):
  new_vm_state = instance['vm_state']
 if (not new_task_state):
  new_task_state = instance['task_state']
 states_payload = {'old_state': old_vm_state, 'state': new_vm_state, 'old_task_state': old_task_state, 'new_task_state': new_task_state}
 payload.update(states_payload)
 (audit_start, audit_end) = audit_period_bounds(current_period=True)
 payload['audit_period_beginning'] = audit_start
 payload['audit_period_ending'] = audit_end
 bw = bandwidth_usage(instance, audit_start)
 payload['bandwidth'] = bw
 publisher_id = notifier_api.publisher_id(service, host)
 notifier_api.notify(context, publisher_id, 'compute.instance.update', notifier_api.INFO, payload)

def _send_instance_update_notification ( context , instance , old_vm_state = None , old_task_state = None , new_vm_state = None , new_task_state = None , service = 'compute' , host = None ) : payload = info_from_instance ( context , instance , None , None ) if ( not new_vm_state ) : new_vm_state = instance [ 'vm_state' ] if ( not new_task_state ) : new_task_state = instance [ 'task_state' ] states_payload = { 'old_state' : old_vm_state , 'state' : new_vm_state , 'old_task_state' : old_task_state , 'new_task_state' : new_task_state } payload . update ( states_payload ) ( audit_start , audit_end ) = audit_period_bounds ( current_period = True ) payload [ 'audit_period_beginning' ] = audit_start payload [ 'audit_period_ending' ] = audit_end bw = bandwidth_usage ( instance , audit_start ) payload [ 'bandwidth' ] = bw publisher_id = notifier_api . publisher_id ( service , host ) notifier_api . notify ( context , publisher_id , 'compute.instance.update' , notifier_api . INFO , payload )
send compute .