Sha256: 0ab6034a91bd6453b0403acac4a2eda6df620adb7bb6366347a02903a82ae2aa

Contents?: true

Size: 456 Bytes

Versions: 8

Compression:

Stored size: 456 Bytes

Contents

module ForemanInventoryUpload
  module Generators
    module FactHelpers
      extend ActiveSupport::Concern

      def fact_value(host, fact_name)
        value_record = host.fact_values.find do |fact_value|
          fact_value.fact_name_id == ForemanInventoryUpload::Generators::Queries.fact_names[fact_name]
        end
        value_record&.value
      end

      def kilobytes_to_bytes(kilobytes)
        kilobytes * 1024
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
foreman_rh_cloud-0.9.5 lib/foreman_inventory_upload/generators/fact_helpers.rb
foreman_rh_cloud-1.0.5 lib/foreman_inventory_upload/generators/fact_helpers.rb
foreman_rh_cloud-2.0.5 lib/foreman_inventory_upload/generators/fact_helpers.rb
foreman_rh_cloud-0.9.4.1 lib/foreman_inventory_upload/generators/fact_helpers.rb
foreman_rh_cloud-1.0.4.1 lib/foreman_inventory_upload/generators/fact_helpers.rb
foreman_rh_cloud-1.0.4 lib/foreman_inventory_upload/generators/fact_helpers.rb
foreman_rh_cloud-2.0.4 lib/foreman_inventory_upload/generators/fact_helpers.rb
foreman_rh_cloud-0.9.4 lib/foreman_inventory_upload/generators/fact_helpers.rb