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 6, 2018
1 parent 4984e9e commit fd47ac4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 67 deletions.
63 changes: 0 additions & 63 deletions app/models/manageiq/providers/openstack/builder.rb

This file was deleted.

17 changes: 17 additions & 0 deletions app/models/manageiq/providers/openstack/inventory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,21 @@ class ManageIQ::Providers::Openstack::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
"CloudManager"
end

def self.parser_classes_for(_ems, target)
case target
when ManagerRefresh::TargetCollection
[ManageIQ::Providers::Openstack::Inventory::Parser::CloudManager,
ManageIQ::Providers::Openstack::Inventory::Parser::NetworkManager,
ManageIQ::Providers::Openstack::Inventory::Parser::StorageManager::CinderManager]
else
super
end
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ManageIQ::Providers::Openstack::Inventory::Collector::CinderManager < ManageIQ::Providers::Openstack::Inventory::Collector
class ManageIQ::Providers::Openstack::Inventory::Collector::StorageManager::CinderManager < ManageIQ::Providers::Openstack::Inventory::Collector
include ManageIQ::Providers::Openstack::Inventory::Collector::HelperMethods

def cloud_volumes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ManageIQ::Providers::Openstack::Inventory::Parser::CinderManager < ManageIQ::Providers::Openstack::Inventory::Parser
class ManageIQ::Providers::Openstack::Inventory::Parser::StorageManager::CinderManager < ManageIQ::Providers::Openstack::Inventory::Parser
def parse
cloud_volumes
cloud_volume_snapshots
Expand Down Expand Up @@ -63,7 +63,7 @@ def cloud_volume_types
volume_type = persister.cloud_volume_types.find_or_build(t.id)
volume_type.type = "ManageIQ::Providers::Openstack::CloudManager::CloudVolumeType"
volume_type.name = t.name
unless t.extra_specs.blank?
if t.extra_specs.present?
volume_type.backend_name = t.extra_specs["volume_backend_name"]
end
volume_type.description = t.attributes["description"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ManageIQ::Providers::Openstack::Inventory::Persister::CinderManager < ManageIQ::Providers::Openstack::Inventory::Persister
class ManageIQ::Providers::Openstack::Inventory::Persister::StorageManager::CinderManager < ManageIQ::Providers::Openstack::Inventory::Persister
include ManageIQ::Providers::Openstack::Inventory::Persister::Definitions::CloudCollections
include ManageIQ::Providers::Openstack::Inventory::Persister::Definitions::NetworkCollections
include ManageIQ::Providers::Openstack::Inventory::Persister::Definitions::StorageCollections
Expand Down

0 comments on commit fd47ac4

Please sign in to comment.