From 4e23c99b60f467481ac0ddcdeab6548316aad931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Hal=C3=A1sz?= Date: Tue, 25 Apr 2017 19:55:54 +0200 Subject: [PATCH] Connect clusterless hosts directly to the provider in infra topology https://bugzilla.redhat.com/show_bug.cgi?id=1440263 --- app/services/infra_topology_service.rb | 6 +++++- app/services/topology_service.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/services/infra_topology_service.rb b/app/services/infra_topology_service.rb index 57dab755ac6..5bb8aa55f64 100644 --- a/app/services/infra_topology_service.rb +++ b/app/services/infra_topology_service.rb @@ -5,13 +5,17 @@ class InfraTopologyService < TopologyService @included_relations = [ :tags, - :ems_clusters => [ + :ems_clusters => [ :tags, :hosts => [ :tags, :vms => :tags ] ], + :clusterless_hosts => [ + :tags, + :vms => :tags + ], ] def entity_type(entity) diff --git a/app/services/topology_service.rb b/app/services/topology_service.rb index 7500170f51c..e271f01dfc8 100644 --- a/app/services/topology_service.rb +++ b/app/services/topology_service.rb @@ -69,7 +69,7 @@ def build_recursive_topology(entity, entity_relationships_mapping, topo_items, l unless entity_relationships_mapping.nil? entity_relationships_mapping.keys.each do |rel_name| relations = entity.send(rel_name.to_s.underscore.downcase) - if relations.kind_of?(ActiveRecord::Associations::CollectionProxy) + if relations.respond_to?(:each) relations.each do |relation| build_rel_data_and_links(entity, entity_relationships_mapping, rel_name, links, relation, topo_items) end