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
  
  
  
  
  
  
  
  
  
  
  #candlepin_id_cert, #cp_owner_id, #upstream_owner
  
  
  
  
  
  
  
  
  
  
  #execute_cloud_request
  
  
  
  
    Instance Method Details
    
      
  
  
    #create_facets  ⇒ Object 
  
  
  
  
    
      
22
23
24
25
26
27 
     | 
    
      # File 'lib/inventory_sync/async/inventory_hosts_sync.rb', line 22
def create_facets
    results = yield
  add_missing_insights_facets(results.organization, results.host_uuids)
  results
end
     | 
  
 
    
      
  
  
    #create_missing_hosts  ⇒ Object 
  
  
  
  
    
      
29
30
31
32
33
34
35
36
37
38 
     | 
    
      # File 'lib/inventory_sync/async/inventory_hosts_sync.rb', line 29
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 
     | 
    
      # File 'lib/inventory_sync/async/inventory_hosts_sync.rb', line 10
def plan(organizations)
    super(organizations)
  plan_self_host_sync
end
     | 
  
 
    
      
  
  
    #rescue_strategy_for_self  ⇒ Object 
  
  
  
  
    
      
40
41
42 
     | 
    
      # File 'lib/inventory_sync/async/inventory_hosts_sync.rb', line 40
def rescue_strategy_for_self
  Dynflow::Action::Rescue::Fail
end 
     | 
  
 
    
      
  
  
    #setup_facet_transaction  ⇒ Object 
  
  
  
  
    
      
16
17
18
19
20 
     | 
    
      # File 'lib/inventory_sync/async/inventory_hosts_sync.rb', line 16
def setup_facet_transaction
  ActiveRecord::Base.transaction do
    yield
  end
end
     |