From 08ae74313fd477397a498b15cc503b23e69e8fff Mon Sep 17 00:00:00 2001 From: Sam Lucidi Date: Fri, 27 Apr 2018 14:28:21 -0400 Subject: [PATCH] Move CinderManager inventory classes --- app/models/manageiq/providers/openstack/builder.rb | 8 ++++---- .../manageiq/providers/openstack/inventory/collector.rb | 1 + .../collector/{storage_manager => }/cinder_manager.rb | 2 +- .../manageiq/providers/openstack/inventory/parser.rb | 1 + .../parser/{storage_manager => }/cinder_manager.rb | 2 +- .../manageiq/providers/openstack/inventory/persister.rb | 1 + .../persister/{storage_manager => }/cinder_manager.rb | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) rename app/models/manageiq/providers/openstack/inventory/collector/{storage_manager => }/cinder_manager.rb (83%) rename app/models/manageiq/providers/openstack/inventory/parser/{storage_manager => }/cinder_manager.rb (96%) rename app/models/manageiq/providers/openstack/inventory/persister/{storage_manager => }/cinder_manager.rb (88%) diff --git a/app/models/manageiq/providers/openstack/builder.rb b/app/models/manageiq/providers/openstack/builder.rb index 82aeafa37..a1aad6416 100644 --- a/app/models/manageiq/providers/openstack/builder.rb +++ b/app/models/manageiq/providers/openstack/builder.rb @@ -8,9 +8,9 @@ def build_inventory(ems, target) inventory( ems, target, - ManageIQ::Providers::Openstack::Inventory::Collector::StorageManager::CinderManager, - ManageIQ::Providers::Openstack::Inventory::Persister::StorageManager::CinderManager, - [ManageIQ::Providers::Openstack::Inventory::Parser::StorageManager::CinderManager] + ManageIQ::Providers::Openstack::Inventory::Collector::CinderManager, + ManageIQ::Providers::Openstack::Inventory::Persister::CinderManager, + [ManageIQ::Providers::Openstack::Inventory::Parser::CinderManager] ) when ManageIQ::Providers::Openstack::NetworkManager inventory( @@ -28,7 +28,7 @@ def build_inventory(ems, target) ManageIQ::Providers::Openstack::Inventory::Persister::TargetCollection, [ManageIQ::Providers::Openstack::Inventory::Parser::CloudManager, ManageIQ::Providers::Openstack::Inventory::Parser::NetworkManager, - ManageIQ::Providers::Openstack::Inventory::Parser::StorageManager::CinderManager] + ManageIQ::Providers::Openstack::Inventory::Parser::CinderManager] ) else # Fallback to ems refresh diff --git a/app/models/manageiq/providers/openstack/inventory/collector.rb b/app/models/manageiq/providers/openstack/inventory/collector.rb index 055a26333..b09adba86 100644 --- a/app/models/manageiq/providers/openstack/inventory/collector.rb +++ b/app/models/manageiq/providers/openstack/inventory/collector.rb @@ -4,6 +4,7 @@ class ManageIQ::Providers::Openstack::Inventory::Collector < ManagerRefresh::Inv require_nested :CloudManager require_nested :NetworkManager + require_nested :CinderManager require_nested :TargetCollection attr_reader :availability_zones diff --git a/app/models/manageiq/providers/openstack/inventory/collector/storage_manager/cinder_manager.rb b/app/models/manageiq/providers/openstack/inventory/collector/cinder_manager.rb similarity index 83% rename from app/models/manageiq/providers/openstack/inventory/collector/storage_manager/cinder_manager.rb rename to app/models/manageiq/providers/openstack/inventory/collector/cinder_manager.rb index ac66d351d..aa4eb96b7 100644 --- a/app/models/manageiq/providers/openstack/inventory/collector/storage_manager/cinder_manager.rb +++ b/app/models/manageiq/providers/openstack/inventory/collector/cinder_manager.rb @@ -1,4 +1,4 @@ -class ManageIQ::Providers::Openstack::Inventory::Collector::StorageManager::CinderManager < ManageIQ::Providers::Openstack::Inventory::Collector +class ManageIQ::Providers::Openstack::Inventory::Collector::CinderManager < ManageIQ::Providers::Openstack::Inventory::Collector include ManageIQ::Providers::Openstack::Inventory::Collector::HelperMethods def cloud_volumes diff --git a/app/models/manageiq/providers/openstack/inventory/parser.rb b/app/models/manageiq/providers/openstack/inventory/parser.rb index db786d455..c011ab7fc 100644 --- a/app/models/manageiq/providers/openstack/inventory/parser.rb +++ b/app/models/manageiq/providers/openstack/inventory/parser.rb @@ -1,4 +1,5 @@ class ManageIQ::Providers::Openstack::Inventory::Parser < ManagerRefresh::Inventory::Parser require_nested :CloudManager require_nested :NetworkManager + require_nested :CinderManager end diff --git a/app/models/manageiq/providers/openstack/inventory/parser/storage_manager/cinder_manager.rb b/app/models/manageiq/providers/openstack/inventory/parser/cinder_manager.rb similarity index 96% rename from app/models/manageiq/providers/openstack/inventory/parser/storage_manager/cinder_manager.rb rename to app/models/manageiq/providers/openstack/inventory/parser/cinder_manager.rb index 3cf53761c..c0a6dedf2 100644 --- a/app/models/manageiq/providers/openstack/inventory/parser/storage_manager/cinder_manager.rb +++ b/app/models/manageiq/providers/openstack/inventory/parser/cinder_manager.rb @@ -1,4 +1,4 @@ -class ManageIQ::Providers::Openstack::Inventory::Parser::StorageManager::CinderManager < ManageIQ::Providers::Openstack::Inventory::Parser +class ManageIQ::Providers::Openstack::Inventory::Parser::CinderManager < ManageIQ::Providers::Openstack::Inventory::Parser def parse cloud_volumes cloud_volume_snapshots diff --git a/app/models/manageiq/providers/openstack/inventory/persister.rb b/app/models/manageiq/providers/openstack/inventory/persister.rb index c0bd51ed9..17c29a6b5 100644 --- a/app/models/manageiq/providers/openstack/inventory/persister.rb +++ b/app/models/manageiq/providers/openstack/inventory/persister.rb @@ -1,6 +1,7 @@ class ManageIQ::Providers::Openstack::Inventory::Persister < ManagerRefresh::Inventory::Persister require_nested :CloudManager require_nested :NetworkManager + require_nested :CinderManager require_nested :TargetCollection # TODO(lsmola) figure out a way to pass collector info, probably via target, then remove the below diff --git a/app/models/manageiq/providers/openstack/inventory/persister/storage_manager/cinder_manager.rb b/app/models/manageiq/providers/openstack/inventory/persister/cinder_manager.rb similarity index 88% rename from app/models/manageiq/providers/openstack/inventory/persister/storage_manager/cinder_manager.rb rename to app/models/manageiq/providers/openstack/inventory/persister/cinder_manager.rb index 29b02da8a..5ffe3d127 100644 --- a/app/models/manageiq/providers/openstack/inventory/persister/storage_manager/cinder_manager.rb +++ b/app/models/manageiq/providers/openstack/inventory/persister/cinder_manager.rb @@ -1,4 +1,4 @@ -class ManageIQ::Providers::Openstack::Inventory::Persister::StorageManager::CinderManager < ManageIQ::Providers::Openstack::Inventory::Persister +class ManageIQ::Providers::Openstack::Inventory::Persister::CinderManager < ManageIQ::Providers::Openstack::Inventory::Persister def initialize_inventory_collections add_inventory_collections(storage, %i(