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

Add command "boss shutdown"

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@230 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
Likun Zhang
2009-10-30 17:18:12 +00:00
parent 60f2b2c298
commit 9fb2d5bb2f
2 changed files with 6 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ if __name__ == '__main__':
cc = ISC.CC.Session() cc = ISC.CC.Session()
cc.group_subscribe("BigTool") cc.group_subscribe("BigTool")
cc.group_subscribe("ConfigManager") cc.group_subscribe("ConfigManager")
cc.group_subscribe("Boss")
tool = BigTool(cc) tool = BigTool(cc)
_prepare_fake_data(tool) _prepare_fake_data(tool)

View File

@@ -223,7 +223,8 @@ class BigTool(Cmd):
def apply_cmd(self, cmd): def apply_cmd(self, cmd):
if not self.cc: if not self.cc:
return return
groupName = (cmd.module == "boss") and "Boss" or "ConfigManager"
try: try:
content = [cmd.module, cmd.command] content = [cmd.module, cmd.command]
values = cmd.params.values() values = cmd.params.values()
@@ -233,13 +234,13 @@ class BigTool(Cmd):
msg = {"command":content} msg = {"command":content}
print("begin to send the message...") print("begin to send the message...")
self.cc.group_sendmsg(msg, "ConfigManager") self.cc.group_sendmsg(msg, groupName)
print("waiting for configure manager reply...") print("waiting for %s reply..." % groupName)
reply, env = self.cc.group_recvmsg(False) reply, env = self.cc.group_recvmsg(False)
print("received reply:", reply) print("received reply:", reply)
except ISC.CC.SessionError: except ISC.CC.SessionError:
print("Error commucation with configure manager") print("Error communication with %s" % groupName)