Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InventoryCollection definitions for vmware infra #17729

Merged
merged 1 commit into from
Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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