Skip to content

Commit

Permalink
Moving Inventory Builder functionality to Inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
slemrmartin committed Sep 5, 2018
1 parent fdc51df commit d41a633
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 59 deletions.
53 changes: 0 additions & 53 deletions app/models/manageiq/providers/redhat/builder.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def collect_inventory_for_targets(ems, targets)
_log.info "Filtering inventory for #{target.class} [#{target.name}] id: [#{target.id}]..."

if ems.use_graph_refresh?
data = ManageIQ::Providers::Redhat::Builder.build_inventory(ems, target)
data = ManageIQ::Providers::Redhat::Inventory.build(ems, target)

# TODO: remove when graph refresh supports ems updates
ems.api_version = inventory.service.version_string
Expand Down
6 changes: 6 additions & 0 deletions app/models/manageiq/providers/redhat/inventory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ class ManageIQ::Providers::Redhat::Inventory < ManageIQ::Providers::Inventory
require_nested :Collector
require_nested :Parser
require_nested :Persister

# Default manager for building collector/parser/persister classes
# when failed to get class name from refresh target automatically
def self.default_manager_name
"InfraManager"
end
end
5 changes: 1 addition & 4 deletions app/models/manageiq/providers/redhat/inventory/persister.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ class ManageIQ::Providers::Redhat::Inventory::Persister < ManageIQ::Providers::I
require_nested :InfraManager
require_nested :TargetCollection

attr_reader :collector

def initialize(manager, target, collector)
def initialize(manager, target)
@manager = manager
@target = target
@collector = collector

@collections = {}
@collection_group = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def collect_inventory_for_targets(ems, targets)
_log.info("Filtering inventory for #{target.class} [#{target_name}] id: [#{target.id}]...")

if ::Settings.ems_refresh.redhat_network.try(:inventory_object_refresh)
inventory = ManageIQ::Providers::Redhat::Builder.build_inventory(ems, target)
inventory = ManageIQ::Providers::Redhat::Inventory.build(ems, target)
end

_log.info("Filtering inventory...Complete")
Expand Down

0 comments on commit d41a633

Please sign in to comment.