def send_update_with_states(context, instance, old_vm_state, new_vm_state, old_task_state, new_task_state, service='compute', host=None, verify_states=False):
 if (not CONF.notifications.notify_on_state_change):
  return
 fire_update = True
 if verify_states:
  fire_update = False
  if (old_vm_state != new_vm_state):
   fire_update = True
  elif ((CONF.notifications.notify_on_state_change == 'vm_and_task_state') and (old_task_state != new_task_state)):
   fire_update = True
 if fire_update:
  try:
   _send_instance_update_notification(context, instance, old_vm_state=old_vm_state, old_task_state=old_task_state, new_vm_state=new_vm_state, new_task_state=new_task_state, service=service, host=host)
  except exception.InstanceNotFound:
   LOG.debug('Failed to send instance update notification. The instance could not be found and was most likely deleted.', instance=instance)
  except Exception:
   LOG.exception(_LE('Failed to send state update notification'), instance=instance)

def send_update_with_states ( context , instance , old_vm_state , new_vm_state , old_task_state , new_task_state , service = 'compute' , host = None , verify_states = False ) : if ( not CONF . notifications . notify_on_state_change ) : return fire_update = True if verify_states : fire_update = False if ( old_vm_state != new_vm_state ) : fire_update = True elif ( ( CONF . notifications . notify_on_state_change == 'vm_and_task_state' ) and ( old_task_state != new_task_state ) ) : fire_update = True if fire_update : try : _send_instance_update_notification ( context , instance , old_vm_state = old_vm_state , old_task_state = old_task_state , new_vm_state = new_vm_state , new_task_state = new_task_state , service = service , host = host ) except exception . InstanceNotFound : LOG . debug ( 'Failed to send instance update notification. The instance could not be found and was most likely deleted.' , instance = instance ) except Exception : LOG . exception ( _LE ( 'Failed to send state update notification' ) , instance = instance )
send compute .