Skip to content

Commit

Permalink
InventoryCollection definitions for vmware infra
Browse files Browse the repository at this point in the history
Also fix for merging IC properties
  • Loading branch information
slemrmartin committed Jul 19, 2018
1 parent cd3ac20 commit 46c83c7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/models/manager_refresh/inventory_collection/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,15 @@ def remove_dependency_attributes(key)
def to_hash
add_inventory_attributes(auto_inventory_attributes) if @options[:auto_inventory_attributes]

@properties.merge(
:inventory_object_attributes => @inventory_object_attributes,
:builder_params => @default_values,
:dependency_attributes => @dependency_attributes
)
@properties[:inventory_object_attributes] ||= @inventory_object_attributes

@properties[:builder_params] ||= {}
@properties[:builder_params].merge!(@default_values)

@properties[:dependency_attributes] ||= {}
@properties[:dependency_attributes].merge!(@dependency_attributes)

@properties
end

protected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,30 @@ def snapshot_parent
:custom_save_block => snapshot_parent_save_block
)
end

def customization_specs
add_properties(:manager_ref => %i(name))

add_common_default_values
end

def miq_scsi_luns
add_properties(
:manager_ref => %i(miq_scsi_target uid_ems),
:parent_inventory_collections => %i(hosts)
)
end

def miq_scsi_targets
add_properties(
:manager_ref => %i(guest_device uid_ems),
:parent_inventory_collections => %i(hosts)
)
end

def storage_profiles
add_common_default_values
end
end
end
end
Expand Down

0 comments on commit 46c83c7

Please sign in to comment.