def notify_about_instance_usage(notifier, context, instance, event_suffix, network_info=None, system_metadata=None, extra_usage_info=None, fault=None):
 if (not extra_usage_info):
  extra_usage_info = {}
 usage_info = notifications.info_from_instance(context, instance, network_info, system_metadata, **extra_usage_info)
 if fault:
  fault_payload = exception_to_dict(fault)
  LOG.debug(fault_payload['message'], instance=instance)
  usage_info.update(fault_payload)
 if event_suffix.endswith('error'):
  method = notifier.error
 else:
  method = notifier.info
 method(context, ('compute.instance.%s' % event_suffix), usage_info)

def notify_about_instance_usage ( notifier , context , instance , event_suffix , network_info = None , system_metadata = None , extra_usage_info = None , fault = None ) : if ( not extra_usage_info ) : extra_usage_info = { } usage_info = notifications . info_from_instance ( context , instance , network_info , system_metadata , ** extra_usage_info ) if fault : fault_payload = exception_to_dict ( fault ) LOG . debug ( fault_payload [ 'message' ] , instance = instance ) usage_info . update ( fault_payload ) if event_suffix . endswith ( 'error' ) : method = notifier . error else : method = notifier . info method ( context , ( 'compute.instance.%s' % event_suffix ) , usage_info )
send a notification about an instance .