Sha256: d35f28bafdd3c1cadae0e70ab7682f0f1557f2922e26f6f00096d57e278e7657

Contents?: true

Size: 511 Bytes

Versions: 69

Compression:

Stored size: 511 Bytes

Contents

module ForemanTasks
  class Task::StatusExplicator
    ANY = 1
    ERRONEOUS_STATUSES = [
      { :state => 'paused', :result => ANY },
      { :state => ANY, :result => 'error' },
      { :state => ANY, :result => 'warning' }
    ].freeze
    def is_erroneous(task)
      remainder = ERRONEOUS_STATUSES.select do |status|
        (status[:state] == ANY || status[:state] == task.state) &&
          (status[:result] == ANY || status[:result] == task.result)
      end
      !remainder.empty?
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
foreman-tasks-0.10.2 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-0.10.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-0.9.5 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-0.10.0 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-0.9.4 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-0.9.3 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-0.9.2 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-0.9.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-0.9.0 app/models/foreman_tasks/task/status_explicator.rb