Skip to content

Commit fe184d2

Browse files
committed
Remove RemoveALL item in NTP Manual mode
XAPI APIs can't set NTP Custom mode with empty custom NTP servers. This is a meaningless selection that NTP is enabled but the time sources are not configured. It is Disable NTP in fact. Signed-off-by: Changlei Li <changlei.li@cloud.com>
1 parent 884fb1c commit fe184d2

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

plugins-base/XSFeatureNTP.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ def CreateMANUALPane(self):
100100
The options are:
101101
- Add New Server
102102
- Remove Server (only shown if servers are already configured)
103-
- Remove All Servers (only shown if servers are already configured)
104103
"""
105104
choiceDefs = [
106105
ChoiceDef(Lang("Add New Server"), lambda: self.HandleManualChoice("ADD"))
@@ -116,12 +115,6 @@ def CreateMANUALPane(self):
116115
Lang("Remove Server"), lambda: self.HandleManualChoice("REMOVE")
117116
)
118117
)
119-
choiceDefs.append(
120-
ChoiceDef(
121-
Lang("Remove All Servers"),
122-
lambda: self.HandleManualChoice("REMOVEALL"),
123-
)
124-
)
125118

126119
self.manualMenu = Menu(self, None, Lang("Configure Network Time"), choiceDefs)
127120

@@ -255,19 +248,14 @@ def HandleManualChoice(self, inChoice):
255248
Handle the user's choice of within the manual NTP configuration method.
256249
257250
param: inChoice: The user's choice of NTP configuration method.
258-
inChoice is one of "ADD", "REMOVE", or "REMOVEALL".
251+
inChoice is one of "ADD", "REMOVE".
259252
"""
260253
data = Data.Inst()
261254
try:
262255
if inChoice == "ADD":
263256
self.ChangeState("ADD")
264257
elif inChoice == "REMOVE":
265258
self.ChangeState("REMOVE")
266-
elif inChoice == "REMOVEALL":
267-
Layout.Inst().PopDialogue()
268-
Layout.Inst().TransientBanner(Lang("Removing All NTP Servers..."))
269-
data.NTPServersSet([])
270-
self.Commit(Lang("All server entries deleted"), "MANUAL")
271259

272260
except Exception as e:
273261
Layout.Inst().PushDialogue(InfoDialogue( Lang("Operation Failed"), Lang(e)))

0 commit comments

Comments
 (0)