Sha256: 9b19cba60f3bf5fddb7ad4607824d7eb33a3e4e876364683f911803030eaad58
Contents?: true
Size: 847 Bytes
Versions: 27
Compression:
Stored size: 847 Bytes
Contents
# frozen_string_literal: true module ForemanDiscovery module UINotifications # Adds notification upon failed discovery class FailedDiscovery < ::UINotifications::Base def initialize(message) @message = message end private def create add_notification if update_notifications.zero? end def update_notifications blueprint.mass_update_expiry end def add_notification Notification.create!( initiator: initiator, audience: ::Notification::AUDIENCE_ADMIN, message: _("One or more hosts with failed discovery due to error: #{@message}"), notification_blueprint: blueprint, ) end def blueprint @blueprint ||= NotificationBlueprint.find_by(name: 'failed_discovery') end end end end
Version data entries
27 entries across 27 versions & 1 rubygems