Commit 1578a6ba authored by Jelte Jansen's avatar Jelte Jansen
Browse files

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
parent d5314b0f
......@@ -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) ]
......
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment