From 128cef62876d20817b4e13615d6e6a1d9b1a4f5f Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Thu, 16 Dec 2021 14:45:01 -0500 Subject: [PATCH] Fix the ems_custom_attributes inventory collection This had a manager_ref of just `:name` but these belong to a polymorphic resource and just the name is not unique. Adding the `:resource` to the manager_ref array makes this unique. --- .../providers/inventory/persister/builder/infra_manager.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/manageiq/providers/inventory/persister/builder/infra_manager.rb b/app/models/manageiq/providers/inventory/persister/builder/infra_manager.rb index d402ac5a860..7626d59e000 100644 --- a/app/models/manageiq/providers/inventory/persister/builder/infra_manager.rb +++ b/app/models/manageiq/providers/inventory/persister/builder/infra_manager.rb @@ -74,7 +74,7 @@ def host_operating_systems def ems_custom_attributes add_properties( :model_class => ::CustomAttribute, - :manager_ref => %i(name), + :manager_ref => %i(resource name), :parent_inventory_collections => %i(vms miq_templates), ) end @@ -84,8 +84,8 @@ def vm_and_template_ems_custom_fields add_properties( :model_class => ::CustomAttribute, - :manager_ref => %i(name), - :parent_inventory_collections => %i(vms) + :manager_ref => %i(resource name), + :parent_inventory_collections => %i(vms miq_templates) ) add_inventory_attributes(%i(section name value source resource))