-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With new definitions of InventoryCollections
- Loading branch information
1 parent
e874281
commit 4df5ba0
Showing
3 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...s/provider/templates/app/models/manageiq/providers/%provider_name%/inventory/persister.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::<%= class_name %>::Inventory::Persister < ManagerRefresh::Inventory::Persister | ||
require_nested :CloudManager | ||
def strategy | ||
nil | ||
end | ||
def parent | ||
manager.presence | ||
end | ||
def shared_options | ||
{ | ||
:strategy => strategy, | ||
:targeted => targeted?, | ||
:parent => parent | ||
} | ||
end | ||
end |
8 changes: 5 additions & 3 deletions
8
...plates/app/models/manageiq/providers/%provider_name%/inventory/persister/cloud_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,5 +1,7 @@ | ||
class ManageIQ::Providers::<%= class_name %>::Inventory::Persister::CloudManager < ManagerRefresh::Inventory::Persister | ||
include ManagerRefresh::Inventory::CloudManager | ||
class ManageIQ::Providers::<%= class_name %>::Inventory::Persister::CloudManager < ManageIQ::Providers::<%= class_name %>::Inventory::Persister | ||
include ManageIQ::Providers::<%= class_name %>::Inventory::Persister::Definitions::CloudCollections | ||
|
||
has_cloud_manager_vms | ||
def initialize_inventory_collections | ||
initialize_cloud_inventory_collections | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
...s/manageiq/providers/%provider_name%/inventory/persister/definitions/cloud_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,9 @@ | ||
module ManageIQ::Providers::<%= class_name %>::Inventory::Persister::Definitions::CloudCollections | ||
extend ActiveSupport::Concern | ||
|
||
def initialize_cloud_inventory_collections | ||
%i(vms).each do |name| | ||
add_collection(cloud, name) | ||
end | ||
end | ||
end |