Sha256: 2afa49c3b34001b68a0cc8510938412ec49649fe2e162801535b6ce57cd51a21

Contents?: true

Size: 730 Bytes

Versions: 65

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

module ForemanAnsible
  class ImportRolesAndVariablesErrorNotification < ::UINotifications::Base
    private

    def initialize(error, task)
      @job_error = error
      @subject = task
    end

    def create
      ::Notification.create!(
        :audience => Notification::AUDIENCE_USER,
        :notification_blueprint => blueprint,
        :initiator => initiator,
        :message => message,
        :subject => subject
      )
    end

    def blueprint
      name = 'Sync_roles_and_variables_failed'
      @blueprint ||= NotificationBlueprint.unscoped.find_by(:name => name)
    end

    def message
      _("Failed to import roles and variables Due to: #{@job_error}")
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
foreman_ansible-10.2.0 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-10.1.0 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-10.0.1 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-10.0.0 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-7.1.4 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-9.0.1 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-7.1.3 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-9.0.0 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-7.1.2 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-7.1.1 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-8.0.1 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-8.0.0 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-7.0.4 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-7.1.0 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-7.0.3 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-7.0.2 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-7.0.1 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-7.0.0 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-6.3.4 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
foreman_ansible-6.3.3 app/services/foreman_ansible/import_roles_and_variables_error_notification.rb