Sha256: 7613199c4d9b33c22b9c66fb0f5f24fbb31c6ab2c3f05140517e02db45b0fb39
Contents?: true
Size: 850 Bytes
Versions: 5
Compression:
Stored size: 850 Bytes
Contents
N_('Long running tasks') notifications = [ { :name => 'long_running_tasks', :description => N_('A notification when tasks run for suspiciously long time'), :mailer => 'TasksMailer', :method => 'long_tasks', :subscription_type => 'alert', }, ] notifications.each do |notification| if (mail = ForemanTasks::TasksMailNotification.find_by(name: notification[:name])) mail.attributes = notification mail.save! if mail.changed? else created_notification = ForemanTasks::TasksMailNotification.create(notification) if created_notification.nil? || created_notification.errors.any? raise ::Foreman::Exception.new(N_("Unable to create mail notification: %s"), SeedHelper.format_errors(created_notification)) end end end
Version data entries
5 entries across 5 versions & 1 rubygems