mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 14:35:29 +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:
@@ -44,14 +44,14 @@ class ConfigManager:
|
|||||||
if cmd[0] == "zone" and cmd[1] == "add":
|
if cmd[0] == "zone" and cmd[1] == "add":
|
||||||
self.add_zone(cmd[2])
|
self.add_zone(cmd[2])
|
||||||
answer["result"] = [ 0 ]
|
answer["result"] = [ 0 ]
|
||||||
elif cmd[0] == "zone" and cmd[1] == "del":
|
elif cmd[0] == "zone" and cmd[1] == "remove":
|
||||||
self.remove_zone(cmd[2])
|
self.remove_zone(cmd[2])
|
||||||
answer["result"] = [ 0 ]
|
answer["result"] = [ 0 ]
|
||||||
elif cmd[o] == "zone" and cmd[1] == "list":
|
elif cmd[0] == "zone" and cmd[1] == "list":
|
||||||
answer["result"] = self.zones.keys()
|
answer["result"] = self.config.zones.keys()
|
||||||
else:
|
else:
|
||||||
print "unknown command: " + cmd
|
print "unknown command: " + str(cmd)
|
||||||
answer["result"] = [ 1, "Unknown command: " + cmd ]
|
answer["result"] = [ 1, "Unknown command: " + str(cmd) ]
|
||||||
except KeyError, ke:
|
except KeyError, ke:
|
||||||
print "unknown module: " + str(msg)
|
print "unknown module: " + str(msg)
|
||||||
answer["result"] = [ 1, "Unknown module: " + str(msg) ]
|
answer["result"] = [ 1, "Unknown module: " + str(msg) ]
|
||||||
|
70
src/lib/cc/python/test_cfgd_sess.py
Normal file
70
src/lib/cc/python/test_cfgd_sess.py
Normal 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
|
||||||
|
|
Reference in New Issue
Block a user