diff -Nru horizon-23.2.0/debian/changelog horizon-23.2.0/debian/changelog --- horizon-23.2.0/debian/changelog 2023-08-20 19:26:39.000000000 +0000 +++ horizon-23.2.0/debian/changelog 2024-03-01 11:47:44.000000000 +0000 @@ -1,3 +1,11 @@ +horizon (4:23.2.0-0ubuntu1~cloud1) lunar; urgency=medium + + * d/p/lp2055409.patch: apply config + OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES to the + instance detail page (LP#2055409). + + -- Rodrigo Barbieri Fri, 01 Mar 2024 11:47:44 +0000 + horizon (4:23.2.0-0ubuntu1~cloud0) jammy-antelope; urgency=medium * New upstream release for the Ubuntu Cloud Archive. diff -Nru horizon-23.2.0/debian/patches/lp2055409.patch horizon-23.2.0/debian/patches/lp2055409.patch --- horizon-23.2.0/debian/patches/lp2055409.patch 1970-01-01 00:00:00.000000000 +0000 +++ horizon-23.2.0/debian/patches/lp2055409.patch 2024-03-01 11:47:44.000000000 +0000 @@ -0,0 +1,88 @@ +From e621c9d745a5a84201d1a625cd252356385059b4 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) +--- + .../dashboards/project/instances/tests.py | 24 ++++++++++++++++--- + .../dashboards/project/instances/views.py | 2 ++ + 2 files changed, 23 insertions(+), 3 deletions(-) + +Index: horizon-23.2.0/openstack_dashboard/dashboards/project/instances/tests.py +=================================================================== +--- horizon-23.2.0.orig/openstack_dashboard/dashboards/project/instances/tests.py ++++ horizon-23.2.0/openstack_dashboard/dashboards/project/instances/tests.py +@@ -1338,7 +1338,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, nova_api_ge_2_47=False): ++ flavor_exception=False, nova_api_ge_2_47=False, ++ skip_servers_update_addresses=False): + + url = reverse('horizon:project:instances:detail', args=[server.id]) + if qs: +@@ -1369,8 +1370,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) + if nova_api_ge_2_47: +@@ -1408,6 +1412,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-23.2.0/openstack_dashboard/dashboards/project/instances/views.py +=================================================================== +--- horizon-23.2.0.orig/openstack_dashboard/dashboards/project/instances/views.py ++++ horizon-23.2.0/openstack_dashboard/dashboards/project/instances/views.py +@@ -535,6 +535,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-23.2.0/debian/patches/series horizon-23.2.0/debian/patches/series --- horizon-23.2.0/debian/patches/series 2023-05-04 08:04:23.000000000 +0000 +++ horizon-23.2.0/debian/patches/series 2024-03-01 11:47:44.000000000 +0000 @@ -3,3 +3,4 @@ ubuntu_settings.patch embedded-xstatic.patch django-4-fix-csrf-reasons-list.patch +lp2055409.patch