Sha256: ca18e8df3d098c8991245b62ad69a79cb692f65f84c28873ed01f570a290a1f1

Contents?: true

Size: 763 Bytes

Versions: 73

Compression:

Stored size: 763 Bytes

Contents

N_('Remote execution job')

notifications = [
  {
    :name               => 'remote_execution_job',
    :description        => N_('A notification when a job finishes'),
    :mailer             => 'RexJobMailer',
    :method             => 'job_finished',
    :subscription_type  => 'alert',
  },
]

notifications.each do |notification|
  if (mail = RexMailNotification.find_by(name: notification[:name]))
    mail.attributes = notification
    mail.save! if mail.changed?
  else
    created_notification = RexMailNotification.create(notification)
    if created_notification.nil? || created_notification.errors.any?
      raise ::Foreman::Exception.new(N_("Unable to create mail notification: %s"),
        format_errors(created_notification))
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
foreman_remote_execution-13.2.7 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-15.0.0 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-14.1.4 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-14.1.3 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-14.1.2 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-14.1.1 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-14.1.0 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-14.0.2 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-14.0.1 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-13.2.6 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-14.0.0 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-13.2.5 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-13.2.4 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-13.2.3 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-13.2.2 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-12.0.7 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-13.2.1 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-13.2.0 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-10.1.3 db/seeds.d/95-mail_notifications.rb
foreman_remote_execution-13.0.0 db/seeds.d/95-mail_notifications.rb