Sha256: 0c11d4380ba8de277e9175535e221f37e457f84b77c2445461b8ea31ca6d065a

Contents?: true

Size: 512 Bytes

Versions: 59

Compression:

Stored size: 512 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

59 entries across 59 versions & 1 rubygems

Version Path
foreman-tasks-10.0.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-10.0.0 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-9.2.3 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-9.2.2 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-9.2.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-9.2.0 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-9.1.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-9.0.4 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-9.1.0 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-9.0.2 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-9.0.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-8.3.3 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-9.0.0 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-8.2.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-8.1.4 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-8.3.2 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-8.3.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-8.1.3 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-8.3.0 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-8.2.0 app/models/foreman_tasks/task/status_explicator.rb