class InventorySync::Async::InventorySelfHostSync
Public Instance Methods
create_facets() { || ... }
click to toggle source
# File lib/inventory_sync/async/inventory_self_host_sync.rb, line 15 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
# File lib/inventory_sync/async/inventory_self_host_sync.rb, line 6 def plan unless cloud_auth_available? logger.debug('Cloud authentication is not available, skipping self host sync') return end plan_self end
rescue_strategy_for_self()
click to toggle source
# File lib/inventory_sync/async/inventory_self_host_sync.rb, line 23 def rescue_strategy_for_self Dynflow::Action::Rescue::Fail end
Private Instance Methods
add_missing_insights_facet(uuids_hash)
click to toggle source
# File lib/inventory_sync/async/inventory_self_host_sync.rb, line 29 def add_missing_insights_facet(uuids_hash) facet = InsightsFacet.find_or_create_by(host_id: ForemanRhCloud.foreman_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 38 def request_url ForemanInventoryUpload.inventory_self_url end