From 1eab9ac6bd73ce8d6ad471a44355550a522674c1 Mon Sep 17 00:00:00 2001 From: Sam Lucidi Date: Wed, 29 Jan 2020 15:13:08 -0500 Subject: [PATCH] Make External-facing networks available to all tenants External-facing networks, at least in Openstack, are supposed to be scoped to all tenants. This updates the tenant_id clause for CloudNetworks to consider whether external_facing is true when deciding whether to allow a tenant to see a network. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1779536 --- app/models/cloud_network.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/cloud_network.rb b/app/models/cloud_network.rb index 3066e74a63b..c94d782d14a 100644 --- a/app/models/cloud_network.rb +++ b/app/models/cloud_network.rb @@ -52,7 +52,7 @@ def self.class_by_ems(ext_management_system, _external = false) end def self.tenant_id_clause_format(tenant_ids) - ["((tenants.id IN (?) OR cloud_networks.shared IS TRUE) AND ext_management_systems.tenant_mapping_enabled IS TRUE) OR ext_management_systems.tenant_mapping_enabled IS FALSE OR ext_management_systems.tenant_mapping_enabled IS NULL", tenant_ids] + ["((tenants.id IN (?) OR cloud_networks.shared IS TRUE OR cloud_networks.external_facing IS TRUE) AND ext_management_systems.tenant_mapping_enabled IS TRUE) OR ext_management_systems.tenant_mapping_enabled IS FALSE OR ext_management_systems.tenant_mapping_enabled IS NULL", tenant_ids] end private