diff -Nru horizon-18.3.5/debian/changelog horizon-18.3.5/debian/changelog --- horizon-18.3.5/debian/changelog 2023-08-22 20:58:11.000000000 +0000 +++ horizon-18.3.5/debian/changelog 2024-03-21 13:54:12.000000000 +0000 @@ -1,3 +1,11 @@ +horizon (3:18.3.5-0ubuntu2.3) focal; urgency=medium + + * d/p/lp2055409.patch: apply config + OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES to the + instance detail page (LP#2055409). + + -- Rodrigo Barbieri Fri, 21 Mar 2024 13:54:12 +0000 + horizon (3:18.3.5-0ubuntu2.2) focal; urgency=medium * d/p/get-ports-directly.patch: Get ports directly instead of via diff -Nru horizon-18.3.5/debian/patches/lp2055409.patch horizon-18.3.5/debian/patches/lp2055409.patch --- horizon-18.3.5/debian/patches/lp2055409.patch 1970-01-01 00:00:00.000000000 +0000 +++ horizon-18.3.5/debian/patches/lp2055409.patch 2024-03-21 13:54:12.000000000 +0000 @@ -0,0 +1,94 @@ +From ef9308fc286433bc2f3cc9eec36c9e873af29ad4 Mon Sep 17 00:00:00 2001 +From: Rodrigo Barbieri +Date: Fri, 26 Jan 2024 15:10:41 -0300 +Subject: [PATCH] Extend configurable skippability of neutron calls to project + instance detail + +The OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES config aids +in envs struggling to load the instance list due to having +too many ports or bad neutron plugin performance. However, +the config does not apply its effect to the instance detail +page, which cannot be loaded due to the neutron calls +taking too long. + +This patch extends the config option to the instance +detail page, allowing the same benefit (and side-effects) +of the instance list page. + +Related-bug: #2045168 +Change-Id: I3e71a208a1c7212e168d63a259f2adddf27dbabf +(cherry picked from commit 95089025fda7c8cce6f7195e2a63f7f09efc9e0a) +(cherry picked from commit 4de36bb649c514f50d2a958c9277097a08b23cec) +(cherry picked from commit e621c9d745a5a84201d1a625cd252356385059b4) +(cherry picked from commit 8e624332831ec0a2638f917327abf971a407cf64) +(cherry picked from commit 04cc79c9914bc137f413a47f8abfed856cebe21a) +(cherry picked from commit 5ecdf818b4e5d6fa425736341e77af46816df5fb) +(cherry picked from commit e0e0e576d5933b14ebe24b18555fa8cd4f8d8aee) +(cherry picked from commit 2d1a215f882e5d68f16ee62e0cdbfeb0ba07aa40) +--- + .../dashboards/project/instances/tests.py | 24 ++++++++++++++++--- + .../dashboards/project/instances/views.py | 2 ++ + 2 files changed, 23 insertions(+), 3 deletions(-) + +Index: horizon-18.3.5/openstack_dashboard/dashboards/project/instances/tests.py +=================================================================== +--- horizon-18.3.5.orig/openstack_dashboard/dashboards/project/instances/tests.py ++++ horizon-18.3.5/openstack_dashboard/dashboards/project/instances/tests.py +@@ -1434,7 +1434,8 @@ class InstanceDetailTests(InstanceTestBa + def _get_instance_details(self, server, qs=None, + flavor_return=None, volumes_return=None, + security_groups_return=None, +- flavor_exception=False): ++ flavor_exception=False, ++ skip_servers_update_addresses=False): + + url = reverse('horizon:project:instances:detail', args=[server.id]) + if qs: +@@ -1467,8 +1468,11 @@ class InstanceDetailTests(InstanceTestBa + + self.mock_server_get.assert_called_once_with( + helpers.IsHttpRequest(), server.id) +- self.mock_servers_update_addresses.assert_called_once_with( +- helpers.IsHttpRequest(), mock.ANY) ++ if skip_servers_update_addresses: ++ self.mock_servers_update_addresses.assert_not_called() ++ else: ++ self.mock_servers_update_addresses.assert_called_once_with( ++ helpers.IsHttpRequest(), mock.ANY) + self.mock_instance_volumes_list.assert_called_once_with( + helpers.IsHttpRequest(), server.id) + self.mock_flavor_get.assert_called_once_with( +@@ -1504,6 +1508,20 @@ class InstanceDetailTests(InstanceTestBa + self.mock_is_extension_supported.assert_called_once_with( + helpers.IsHttpRequest(), 'mac-learning') + ++ @override_settings(OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES=False) ++ @helpers.create_mocks({api.neutron: ['is_extension_supported']}) ++ def test_instance_details_skip_servers_update_addresses(self): ++ server = self.servers.first() ++ ++ self.mock_is_extension_supported.return_value = False ++ ++ self._get_instance_details( ++ server, ++ skip_servers_update_addresses=True) ++ ++ self.mock_is_extension_supported.assert_called_once_with( ++ helpers.IsHttpRequest(), 'mac-learning') ++ + @helpers.create_mocks({api.neutron: ['is_extension_supported']}) + def test_instance_details_volume_sorting(self): + server = self.servers.first() +Index: horizon-18.3.5/openstack_dashboard/dashboards/project/instances/views.py +=================================================================== +--- horizon-18.3.5.orig/openstack_dashboard/dashboards/project/instances/views.py ++++ horizon-18.3.5/openstack_dashboard/dashboards/project/instances/views.py +@@ -540,6 +540,8 @@ class DetailView(tabs.TabView): + exceptions.handle(self.request, msg, ignore=True) + + def _update_addresses(self, instance): ++ if not settings.OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES: ++ return + instance_id = instance.id + try: + api.network.servers_update_addresses(self.request, [instance]) diff -Nru horizon-18.3.5/debian/patches/series horizon-18.3.5/debian/patches/series --- horizon-18.3.5/debian/patches/series 2023-08-22 20:58:11.000000000 +0000 +++ horizon-18.3.5/debian/patches/series 2024-03-21 13:54:12.000000000 +0000 @@ -6,3 +6,4 @@ 0001-Fix-for-Resize-instance-button.patch lp1827120.patch get-ports-directly.patch +lp2055409.patch