Skip to content

Commit

Permalink
Use the host_geust_devices inventory collection
Browse files Browse the repository at this point in the history
Prevent duplication of host guest_devices by using the correct
association.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1691109
  • Loading branch information
agrare committed Apr 25, 2019
1 parent 04ac9e1 commit d4f2903
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Expand Up @@ -239,7 +239,7 @@ def host_guest_devices(persister_hardware, host, nics, networks)
attributes[:network] = persister_nic
end

persister.guest_devices.find_or_build_by(
persister.host_guest_devices.find_or_build_by(
:hardware => persister_hardware,
:uid_ems => nic.id
).assign_attributes(attributes)
Expand Down
Expand Up @@ -52,6 +52,7 @@ def add_datacenters_group

def add_hosts_group
%i(hosts
host_guest_devices
host_hardwares
host_networks
host_operating_systems
Expand Down

0 comments on commit d4f2903

Please sign in to comment.