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 <agustin.carranza@windriver.com>
Change-Id: Ib318f5e9bd559f26a6a73e6189a6e6bd9f8a17df
This commit is contained in:
Agustin Carranza 2023-07-13 15:33:00 -03:00
parent d9ec96acc7
commit e4c24875c0
1 changed files with 1 additions and 1 deletions

View File

@ -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,