From e4c24875c0a710646a82e396ddf85ba1ad939407 Mon Sep 17 00:00:00 2001 From: Agustin Carranza Date: Thu, 13 Jul 2023 15:33:00 -0300 Subject: [PATCH] Fix NTP table 'Displaying 1 item' when being empty Table in System Configuration page shows the message "Displaying 1 item" when there is no item to display. This change fixes the issue by appending items to the list only when NTP servers are found. Test plan: PASS: * Deploy a system and not configure NTP services. * Explore GUI to System Configuration, tab NTP, and check the message 'No items to display.' is presented. PASS: * Deploy a system and configure NTP services. * Explore GUI to System Configuration, tab NTP, and check the message 'Displaying 1 item.' is presented below and above the NTP servers URLs. Closes-bug: 2027731 Signed-off-by: Agustin Carranza Change-Id: Ib318f5e9bd559f26a6a73e6189a6e6bd9f8a17df --- .../starlingx_dashboard/dashboards/admin/system_config/tabs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/system_config/tabs.py b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/system_config/tabs.py index 9b037986..82a84a7d 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/system_config/tabs.py +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/system_config/tabs.py @@ -117,7 +117,7 @@ class cNTPTab(tabs.TableTab): for index, server in enumerate(servers): ntp_data['ntpserver_%s' % (index + 1)] = server - data.append(type('NTP', (object,), ntp_data)()) + data.append(type('NTP', (object,), ntp_data)()) except Exception: exceptions.handle(request,