From ef6267b2e2b6c79d52a321bc0edfc48b8a94d828 Mon Sep 17 00:00:00 2001 From: Marek Aufart Date: Thu, 29 Mar 2018 09:51:00 +0200 Subject: [PATCH] Merge pull request #260 from mansam/fix-parent-subnet-relationship Fix parent subnet relationship (cherry picked from commit 7277126331c7535c08e2a3dfeb3ef8e0af0351ff) https://bugzilla.redhat.com/show_bug.cgi?id=1562785 --- .../providers/openstack/inventory/parser/network_manager.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/manageiq/providers/openstack/inventory/parser/network_manager.rb b/app/models/manageiq/providers/openstack/inventory/parser/network_manager.rb index 5c3dca26b..593d6b6c3 100644 --- a/app/models/manageiq/providers/openstack/inventory/parser/network_manager.rb +++ b/app/models/manageiq/providers/openstack/inventory/parser/network_manager.rb @@ -49,7 +49,9 @@ def cloud_subnets subnet.allocation_pools = s.allocation_pools subnet.host_routes = s.host_routes subnet.ip_version = s.ip_version - subnet.parent_cloud_subnet = persister.cloud_subnets.lazy_find(s.attributes["vsd_managed"]) + if s.attributes["vsd_managed"] + subnet.parent_cloud_subnet = persister.cloud_subnets.lazy_find(s.attributes["vsd_id"]) + end subnet.cloud_tenant = persister.cloud_tenants.lazy_find(s.tenant_id) subnet.cloud_network = persister.cloud_networks.lazy_find(s.network_id) subnet.status = persister.cloud_networks.lazy_find(s.network_id, :key => :status)