Sha256: ff69b8a3304dd98700dc01a9d624dd455726323d06897212df115df72b738d6d

Contents?: true

Size: 811 Bytes

Versions: 73

Compression:

Stored size: 811 Bytes

Contents

module InventorySync
  class InventoryStatus < HostStatus::Status
    DISCONNECT = 0
    SYNC = 1

    def self.status_name
      N_('Inventory')
    end

    def to_global(_options = {})
      case status
      when DISCONNECT
        ::HostStatus::Global::WARN
      when SYNC
        ::HostStatus::Global::OK
      else
        ::HostStatus::Global::WARN
      end
    end

    def to_label
      case status
        when DISCONNECT
          N_('Host was not uploaded to your RH cloud inventory')
        when SYNC
          N_('Successfully uploaded to your RH cloud inventory')
      end
    end

    def to_status(options = {})
      # this method used to calculate status.
      # Since the calculation is done externally we should return the previously calculated status
      status
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
foreman_rh_cloud-5.0.46 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-5.0.45 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-7.0.46 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-5.0.44 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-7.0.45 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-6.0.44 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-5.0.43 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-4.0.36 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-3.0.33 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-6.0.42.2 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-6.0.42.1 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-6.0.43 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-5.0.42 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-6.0.42 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-5.0.41 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-5.0.39 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-5.0.38 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-4.0.35 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-5.0.37 app/models/inventory_sync/inventory_status.rb
foreman_rh_cloud-5.0.36 app/models/inventory_sync/inventory_status.rb