2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

fixup config manager

functionality now working: add zone, remove zone, list zones


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@157 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
Jelte Jansen
2009-10-29 00:30:23 +00:00
parent d5314b0fbf
commit 1578a6ba55
2 changed files with 75 additions and 5 deletions

View File

@@ -44,14 +44,14 @@ class ConfigManager:
if cmd[0] == "zone" and cmd[1] == "add":
self.add_zone(cmd[2])
answer["result"] = [ 0 ]
elif cmd[0] == "zone" and cmd[1] == "del":
elif cmd[0] == "zone" and cmd[1] == "remove":
self.remove_zone(cmd[2])
answer["result"] = [ 0 ]
elif cmd[o] == "zone" and cmd[1] == "list":
answer["result"] = self.zones.keys()
elif cmd[0] == "zone" and cmd[1] == "list":
answer["result"] = self.config.zones.keys()
else:
print "unknown command: " + cmd
answer["result"] = [ 1, "Unknown command: " + cmd ]
print "unknown command: " + str(cmd)
answer["result"] = [ 1, "Unknown command: " + str(cmd) ]
except KeyError, ke:
print "unknown module: " + str(msg)
answer["result"] = [ 1, "Unknown module: " + str(msg) ]

View File

@@ -0,0 +1,70 @@
import ISC
cc = ISC.CC.Session()
cc.group_subscribe("ConfigManager")
cmd = { "command": [ "zone", "add", "vix.com" ] }
print "Sending:"
print cmd
cc.group_sendmsg(cmd, "ConfigManager")
data, routing = cc.group_recvmsg(False)
print "Answer:"
print data
cmd = { "command": [ "zone", "add", "tjeb.nl" ] }
print "Sending:"
print cmd
cc.group_sendmsg(cmd, "ConfigManager")
data, routing = cc.group_recvmsg(False)
print "Answer:"
print data
cmd = { "command": [ "zone", "add", "flame.org" ] }
print "Sending:"
print cmd
cc.group_sendmsg(cmd, "ConfigManager")
data, routing = cc.group_recvmsg(False)
print "Answer:"
print data
cmd = { "command": [ "zone", "list" ] }
print "Sending:"
print cmd
cc.group_sendmsg(cmd, "ConfigManager")
data, routing = cc.group_recvmsg(False)
print "Answer:"
print data
cmd = { "command": [ "zone", "remove", "flame.org" ] }
print "Sending:"
print cmd
cc.group_sendmsg(cmd, "ConfigManager")
data, routing = cc.group_recvmsg(False)
print "Answer:"
print data
cmd = { "command": [ "zone", "list" ] }
print "Sending:"
print cmd
cc.group_sendmsg(cmd, "ConfigManager")
data, routing = cc.group_recvmsg(False)
print "Answer:"
print data
cmd = { "command": [ "zone", "bad_command", "foo" ] }
print "Sending:"
print cmd
cc.group_sendmsg(cmd, "ConfigManager")
data, routing = cc.group_recvmsg(False)
print "Answer:"
print data
cmd = { "command": [ "bad_module", "bad_command", "foo" ] }
print "Sending:"
print cmd
cc.group_sendmsg(cmd, "ConfigManager")
data, routing = cc.group_recvmsg(False)
print "Answer:"
print data