Class: InventorySync::Async::InventoryHostsSync
Constant Summary
collapse
- MAX_IP_STRING_SIZE =
254
Instance Method Summary
collapse
#try_execute
#attempts_before_next_interval, #done!, #done?, #invoke_external_task, #poll_external_task, #poll_intervals, #try_execute
#cert_auth_available?, #execute_cloud_request, #foreman_certificate
#candlepin_id_cert, #cp_owner_id, #upstream_owner
#execute_cloud_request
Instance Method Details
#create_facets ⇒ Object
24
25
26
27
28
29
|
# File 'lib/inventory_sync/async/inventory_hosts_sync.rb', line 24
def create_facets
results = yield
add_missing_insights_facets(results.organization, results.host_uuids)
results
end
|
#create_missing_hosts ⇒ Object
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/inventory_sync/async/inventory_hosts_sync.rb', line 31
def create_missing_hosts
results = yield
missing_hosts = results.missing_hosts.map { |host| to_missing_host_record(host, results.organization) }
InsightsMissingHost.
where.not(insights_id: missing_hosts.map { |host_hash| host_hash[:insights_id] }).
where(organization_id: results.organization.id).delete_all
InsightsMissingHost.upsert_all(missing_hosts) if missing_hosts.present?
end
|
#plan(organizations) ⇒ Object
10
11
12
13
14
15
16
|
# File 'lib/inventory_sync/async/inventory_hosts_sync.rb', line 10
def plan(organizations)
return if ForemanRhCloud.with_iop_smart_proxy?
super(organizations)
plan_self_host_sync
end
|
#rescue_strategy_for_self ⇒ Object
42
43
44
|
# File 'lib/inventory_sync/async/inventory_hosts_sync.rb', line 42
def rescue_strategy_for_self
Dynflow::Action::Rescue::Fail
end
|
#setup_facet_transaction ⇒ Object
18
19
20
21
22
|
# File 'lib/inventory_sync/async/inventory_hosts_sync.rb', line 18
def setup_facet_transaction
ActiveRecord::Base.transaction do
yield
end
end
|