mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
new shutdown command
git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@249 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
parent
ce747fe7b9
commit
1ae988a918
@ -16,7 +16,7 @@ class ConfigManager:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.cc = ISC.CC.Session()
|
self.cc = ISC.CC.Session()
|
||||||
self.cc.group_subscribe("ConfigManager")
|
self.cc.group_subscribe("ConfigManager")
|
||||||
self.cc.group_subscribe("Boss")
|
self.cc.group_subscribe("Boss", "ConfigManager")
|
||||||
self.config = ConfigData()
|
self.config = ConfigData()
|
||||||
self.db_filename = "/tmp/parkinglot.db"
|
self.db_filename = "/tmp/parkinglot.db"
|
||||||
self.running = False
|
self.running = False
|
||||||
@ -69,14 +69,15 @@ class ConfigManager:
|
|||||||
answer["result"] = [ 0 ]
|
answer["result"] = [ 0 ]
|
||||||
elif cmd[0] == "zone" and cmd[1] == "list":
|
elif cmd[0] == "zone" and cmd[1] == "list":
|
||||||
answer["result"] = list(self.config.zones.keys())
|
answer["result"] = list(self.config.zones.keys())
|
||||||
|
elif len(cmd) > 1 and cmd[1] == "shutdown":
|
||||||
|
print("Received shutdown command")
|
||||||
|
self.running = False
|
||||||
else:
|
else:
|
||||||
print("unknown command: " + str(cmd))
|
print("unknown command: " + str(cmd))
|
||||||
answer["result"] = [ 1, "Unknown command: " + str(cmd) ]
|
answer["result"] = [ 1, "Unknown command: " + str(cmd) ]
|
||||||
except IndexError as ie:
|
except IndexError as ie:
|
||||||
print("missing argument")
|
print("missing argument")
|
||||||
answer["result"] = [ 1, "Missing argument in command" ]
|
answer["result"] = [ 1, "Missing argument in command" ]
|
||||||
elif "shutdown" in msg:
|
|
||||||
self.running = False
|
|
||||||
else:
|
else:
|
||||||
print("unknown message: " + str(msg))
|
print("unknown message: " + str(msg))
|
||||||
answer["result"] = [ 1, "Unknown module: " + str(msg) ]
|
answer["result"] = [ 1, "Unknown module: " + str(msg) ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user