def _send_notification(operation, resource_type, resource_id, actor_dict=None, public=True):
 payload = {'resource_info': resource_id}
 if actor_dict:
  payload['actor_id'] = actor_dict['id']
  payload['actor_type'] = actor_dict['type']
  payload['actor_operation'] = actor_dict['actor_operation']
 notify_event_callbacks(SERVICE, resource_type, operation, payload)
 if (public and (CONF.notification_format == 'basic')):
  notifier = _get_notifier()
  if notifier:
   context = {}
   event_type = ('%(service)s.%(resource_type)s.%(operation)s' % {'service': SERVICE, 'resource_type': resource_type, 'operation': operation})
   if _check_notification_opt_out(event_type, outcome=None):
    return
   try:
    notifier.info(context, event_type, payload)
   except Exception:
    LOG.exception(_LE('Failed to send %(res_id)s %(event_type)s notification'), {'res_id': resource_id, 'event_type': event_type})

def _send_notification ( operation , resource_type , resource_id , actor_dict = None , public = True ) : payload = { 'resource_info' : resource_id } if actor_dict : payload [ 'actor_id' ] = actor_dict [ 'id' ] payload [ 'actor_type' ] = actor_dict [ 'type' ] payload [ 'actor_operation' ] = actor_dict [ 'actor_operation' ] notify_event_callbacks ( SERVICE , resource_type , operation , payload ) if ( public and ( CONF . notification_format == 'basic' ) ) : notifier = _get_notifier ( ) if notifier : context = { } event_type = ( '%(service)s.%(resource_type)s.%(operation)s' % { 'service' : SERVICE , 'resource_type' : resource_type , 'operation' : operation } ) if _check_notification_opt_out ( event_type , outcome = None ) : return try : notifier . info ( context , event_type , payload ) except Exception : LOG . exception ( _LE ( 'Failed to send %(res_id)s %(event_type)s notification' ) , { 'res_id' : resource_id , 'event_type' : event_type } )
send notification to inform observers about the affected resource .