Beispiel #1
0
 def _send_notification(self, action):
     payload = service_notification.ServiceStatusPayload(self)
     service_notification.ServiceStatusNotification(
         publisher=notification.NotificationPublisher.from_service_obj(
             self),
         event_type=notification.EventType(object='service', action=action),
         priority=fields.NotificationPriority.INFO,
         payload=payload).emit(self._context)
Beispiel #2
0
 def _send_status_update_notification(self, updates):
     # Note(gibi): We do not trigger notification on version as that field
     # is always dirty, which would cause that nova sends notification on
     # every other field change. See the comment in save() too.
     if set(updates.keys()).intersection(
         {'disabled', 'disabled_reason', 'forced_down'}):
         payload = service_notification.ServiceStatusPayload(self)
         service_notification.ServiceStatusNotification(
             publisher=notification.NotificationPublisher.from_service_obj(
                 self),
             event_type=notification.EventType(
                 object='service', action=fields.NotificationAction.UPDATE),
             priority=fields.NotificationPriority.INFO,
             payload=payload).emit(self._context)