-
Notifications
You must be signed in to change notification settings - Fork 897
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13907 from Ladas/enhanced_inventory_collector_tar…
…get_and_parser_classes Enhanced inventory collector target and parser classes
- Loading branch information
Showing
13 changed files
with
208 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/models/manageiq/providers/ansible_tower/inventory/persister/automation_manager.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class ManageIQ::Providers::AnsibleTower::Inventory::Persister::AutomationManager < ManagerRefresh::Inventory::Persister | ||
def automation | ||
ManageIQ::Providers::AnsibleTower::InventoryCollectionDefault::AutomationManager | ||
end | ||
|
||
def initialize_inventory_collections | ||
add_inventory_collections( | ||
automation, | ||
%i(inventory_root_groups configured_systems configuration_scripts configuration_script_sources configuration_script_payloads), | ||
:builder_params => {:manager => manager} | ||
) | ||
|
||
add_inventory_collections( | ||
automation, | ||
%i(credentials), | ||
:builder_params => {:resource => manager} | ||
) | ||
end | ||
end |
60 changes: 0 additions & 60 deletions
60
app/models/manageiq/providers/ansible_tower/inventory/target/automation_manager.rb
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
...odels/manageiq/providers/ansible_tower/inventory_collection_default/automation_manager.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
class ManageIQ::Providers::AnsibleTower::InventoryCollectionDefault::AutomationManager < ManagerRefresh::InventoryCollectionDefault | ||
class << self | ||
def inventory_root_groups(extra_attributes = {}) | ||
attributes = { | ||
:model_class => ManageIQ::Providers::AutomationManager::InventoryRootGroup, | ||
:association => :inventory_root_groups, | ||
} | ||
attributes.merge!(extra_attributes) | ||
end | ||
|
||
def configured_systems(extra_attributes = {}) | ||
attributes = { | ||
:model_class => ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem, | ||
:association => :configured_systems, | ||
:manager_ref => [:manager_ref], | ||
} | ||
attributes.merge!(extra_attributes) | ||
end | ||
|
||
def configuration_scripts(extra_attributes = {}) | ||
attributes = { | ||
:model_class => ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript, | ||
:association => :configuration_scripts, | ||
:manager_ref => [:manager_ref], | ||
} | ||
attributes.merge!(extra_attributes) | ||
end | ||
|
||
def configuration_script_sources(extra_attributes = {}) | ||
attributes = { | ||
:model_class => ConfigurationScriptSource, | ||
:association => :configuration_script_sources, | ||
:manager_ref => [:manager_ref], | ||
} | ||
attributes.merge!(extra_attributes) | ||
end | ||
|
||
def configuration_script_payloads(extra_attributes = {}) | ||
attributes = { | ||
:model_class => ManageIQ::Providers::AnsibleTower::AutomationManager::Playbook, | ||
:association => :configuration_script_payloads, | ||
:manager_ref => [:manager_ref], | ||
} | ||
attributes.merge!(extra_attributes) | ||
end | ||
|
||
def credentials(extra_attributes = {}) | ||
attributes = { | ||
:model_class => ManageIQ::Providers::AutomationManager::Authentication, | ||
:association => :credentials, | ||
:manager_ref => [:manager_ref], | ||
} | ||
attributes.merge!(extra_attributes) | ||
end | ||
end | ||
end |
55 changes: 0 additions & 55 deletions
55
app/models/manageiq/providers/cloud_manager/refresh_parser_inventory_object.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
class ManagerRefresh::Inventory::Collector | ||
attr_accessor :manager | ||
attr_accessor :target | ||
attr_reader :manager, :target | ||
|
||
def initialize(manager, target) | ||
# @param manager [ManageIQ::Providers::BaseManager] A manager object | ||
# @param target [Object] A refresh Target object | ||
def initialize(manager, refresh_target) | ||
@manager = manager | ||
@target = target | ||
@target = refresh_target | ||
end | ||
|
||
def options | ||
@options ||= Settings.ems_refresh[manager.class.ems_type] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.