From 9fb2d5bb2fb5e9044c259a06dfebc81d1ca0c89f Mon Sep 17 00:00:00 2001 From: Likun Zhang Date: Fri, 30 Oct 2009 17:18:12 +0000 Subject: [PATCH] Add command "boss shutdown" git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@230 e5f2f494-b856-4b98-b285-d166d9295462 --- src/bin/bigtool/run_bigtool.py | 1 + src/lib/bigtool/bigtool.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bin/bigtool/run_bigtool.py b/src/bin/bigtool/run_bigtool.py index 61deb49afc..8c34085395 100644 --- a/src/bin/bigtool/run_bigtool.py +++ b/src/bin/bigtool/run_bigtool.py @@ -32,6 +32,7 @@ if __name__ == '__main__': cc = ISC.CC.Session() cc.group_subscribe("BigTool") cc.group_subscribe("ConfigManager") + cc.group_subscribe("Boss") tool = BigTool(cc) _prepare_fake_data(tool) diff --git a/src/lib/bigtool/bigtool.py b/src/lib/bigtool/bigtool.py index fc3aa8650a..82f6de3176 100644 --- a/src/lib/bigtool/bigtool.py +++ b/src/lib/bigtool/bigtool.py @@ -223,7 +223,8 @@ class BigTool(Cmd): def apply_cmd(self, cmd): if not self.cc: return - + + groupName = (cmd.module == "boss") and "Boss" or "ConfigManager" try: content = [cmd.module, cmd.command] values = cmd.params.values() @@ -233,13 +234,13 @@ class BigTool(Cmd): msg = {"command":content} print("begin to send the message...") - self.cc.group_sendmsg(msg, "ConfigManager") - print("waiting for configure manager reply...") + self.cc.group_sendmsg(msg, groupName) + print("waiting for %s reply..." % groupName) reply, env = self.cc.group_recvmsg(False) print("received reply:", reply) except ISC.CC.SessionError: - print("Error commucation with configure manager") + print("Error communication with %s" % groupName)