class InventorySync::Async::InventorySelfHostSync
Public Instance Methods
create_facets() { || ... }
click to toggle source
# File lib/inventory_sync/async/inventory_self_host_sync.rb, line 17 def create_facets # get the results from the event results = yield add_missing_insights_facet(results.uuid_by_fqdn) unless results.uuid_by_fqdn.empty? results end
plan()
click to toggle source
Calls superclass method
# File lib/inventory_sync/async/inventory_self_host_sync.rb, line 6 def plan host = ForemanRhCloud.foreman_host if host.nil? logger.warn("Skipping self-host inventory sync: no Foreman host record found.") return end super(host.organization) end
rescue_strategy_for_self()
click to toggle source
# File lib/inventory_sync/async/inventory_self_host_sync.rb, line 25 def rescue_strategy_for_self Dynflow::Action::Rescue::Fail end
Private Instance Methods
action_name()
click to toggle source
# File lib/inventory_sync/async/inventory_self_host_sync.rb, line 47 def action_name 'self host sync' end
add_missing_insights_facet(uuids_hash)
click to toggle source
# File lib/inventory_sync/async/inventory_self_host_sync.rb, line 31 def add_missing_insights_facet(uuids_hash) host = ForemanRhCloud.foreman_host return unless host # Guard against nil facet = InsightsFacet.find_or_create_by(host_id: host.id) do |facet| facet.uuid = uuids_hash.values.first end # fix empty uuid in case the facet already exists facet.update(uuid: uuids_hash.values.first) unless facet.uuid end
request_url()
click to toggle source
# File lib/inventory_sync/async/inventory_self_host_sync.rb, line 43 def request_url ForemanInventoryUpload.inventory_self_url end