-
Notifications
You must be signed in to change notification settings - Fork 42
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 #86 from slemrmartin/inventory-collection-builder
Persister: InventoryCollection building through add_collection()
- Loading branch information
Showing
5 changed files
with
32 additions
and
120 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
15 changes: 15 additions & 0 deletions
15
app/models/manageiq/providers/nuage/inventory/persister/definitions/network_collections.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,15 @@ | ||
module ManageIQ::Providers::Nuage::Inventory::Persister::Definitions::NetworkCollections | ||
extend ActiveSupport::Concern | ||
|
||
def initialize_network_inventory_collections | ||
%i(cloud_tenants | ||
cloud_subnets | ||
security_groups | ||
network_routers).each do |name| | ||
|
||
add_collection(network, name) do |builder| | ||
builder.add_properties(:parent => manager) # including targeted | ||
end | ||
end | ||
end | ||
end |
7 changes: 3 additions & 4 deletions
7
app/models/manageiq/providers/nuage/inventory/persister/network_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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
class ManageIQ::Providers::Nuage::Inventory::Persister::NetworkManager < ManageIQ::Providers::Nuage::Inventory::Persister | ||
include ManageIQ::Providers::Nuage::Inventory::Persister::Definitions::NetworkCollections | ||
|
||
def initialize_inventory_collections | ||
add_inventory_collections( | ||
network, | ||
%i(cloud_tenants network_routers cloud_subnets security_groups) | ||
) | ||
initialize_network_inventory_collections | ||
end | ||
end |
33 changes: 5 additions & 28 deletions
33
app/models/manageiq/providers/nuage/inventory/persister/target_collection.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
75 changes: 0 additions & 75 deletions
75
app/models/manageiq/providers/nuage/inventory_collection_default/network_manager.rb
This file was deleted.
Oops, something went wrong.