Skip to content

Commit

Permalink
Added manager_name param for old refresher's parser
Browse files Browse the repository at this point in the history
  • Loading branch information
slemrmartin committed Sep 4, 2018
1 parent 85306be commit 3ee3c8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/models/manageiq/providers/base_manager/refresher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ def parse_targeted_inventory(ems, target, collector)
log_header = format_ems_for_logging(ems)
_log.debug("#{log_header} Parsing inventory...")
persister, = Benchmark.realtime_block(:parse_inventory) do
persister = ManageIQ::Providers::Inventory.persister_class_for(ems, target.class).new(ems, target)
parser = ManageIQ::Providers::Inventory.parser_class_for(ems, target.class).new
persister = ManageIQ::Providers::Inventory.persister_class_for(ems, target, target.class.name.demodulize).new(ems, target)
parser = ManageIQ::Providers::Inventory.parser_class_for(ems, target, target.class.name.demodulize).new

i = ManageIQ::Providers::Inventory.new(persister, collector, parser)
i.parse
Expand Down
18 changes: 10 additions & 8 deletions app/models/manageiq/providers/inventory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,32 @@ def inventory_collections

# Based on the given provider/manager class, this returns correct collector class
#
# @param target class of the Provider/Manager
# @param ems class of the Provider/Manager
# @param target class of refresh's target
# @return [Class] Correct class name of the collector
def self.collector_class_for(ems, target = nil)
def self.collector_class_for(ems, target = nil, manager_name = nil)
target = ems if target.nil?
class_for(ems, target, 'Collector')
class_for(ems, target, 'Collector', manager_name)
end

# Based on the given provider/manager class, this returns correct persister class
#
# @param ems class of the Provider/Manager
# @param target class of refresh's target
# @return [Class] Correct class name of the persister
def self.persister_class_for(ems, target = nil)
def self.persister_class_for(ems, target = nil, manager_name = nil)
target = ems if target.nil?
class_for(ems, target, 'Persister')
class_for(ems, target, 'Persister', manager_name)
end

# Based on the given provider/manager class, this returns correct parser class
#
# @param target class of the Provider/Manager
# @param ems class of the Provider/Manager
# @param target class of refresh's target
# @return [Class] Correct class name of the Parser
def self.parser_class_for(ems, target = nil)
def self.parser_class_for(ems, target = nil, manager_name = nil)
target = ems if target.nil?
class_for(ems, target, 'Parser')
class_for(ems, target, 'Parser', manager_name)
end

# @param ems [ExtManagementSystem]
Expand Down

0 comments on commit 3ee3c8b

Please sign in to comment.