[svn] commit: r248 - in /branches/f2f200910/src: bin/bigtool/run_bigtool.py lib/bigtool/bigtool.py

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Oct 30 19:32:12 UTC 2009


Author: zhanglikun
Date: Fri Oct 30 19:32:11 2009
New Revision: 248

Log:
Add instance name to the message of command "Boss shutdown"

Modified:
    branches/f2f200910/src/bin/bigtool/run_bigtool.py
    branches/f2f200910/src/lib/bigtool/bigtool.py

Modified: branches/f2f200910/src/bin/bigtool/run_bigtool.py
==============================================================================
--- branches/f2f200910/src/bin/bigtool/run_bigtool.py (original)
+++ branches/f2f200910/src/bin/bigtool/run_bigtool.py Fri Oct 30 19:32:11 2009
@@ -18,8 +18,10 @@
     zone_module.add_command(remove_cmd)
     zone_module.add_command(list_cmd)
 
+    shutdown_param = ParamInfo(name = "module_name", desc = "the name of module")
     shutdown_cmd = CommandInfo(name = 'shutdown', desc = "stop bind10",
                                need_inst_param = False)
+    shutdown_cmd.add_param(shutdown_param)
     boss_module = ModuleInfo(name = "boss", desc = "boss of bind10")
     boss_module.add_command(shutdown_cmd)               
 

Modified: branches/f2f200910/src/lib/bigtool/bigtool.py
==============================================================================
--- branches/f2f200910/src/lib/bigtool/bigtool.py (original)
+++ branches/f2f200910/src/lib/bigtool/bigtool.py Fri Oct 30 19:32:11 2009
@@ -219,26 +219,31 @@
         else:
             self.modules[cmd.module].command_help(cmd.command)
 
-            
+
     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()
-           if len(values) > 0:
-               content.append(list(values)[0])
-
-           msg = {"command":content}
-           print("begin to send the message...")
-           
-           self.cc.group_sendmsg(msg, groupName)
-           print("waiting for %s reply..." % groupName)
-
-           reply, env = self.cc.group_recvmsg(False)
-           print("received reply:", reply)
+        instance = '*'
+        content = [cmd.module, cmd.command]
+        groupName = 'ConfigManager'
+        values = cmd.params.values()
+        if cmd.module == 'boss':
+            groupName = "Boss"
+            instance = list(values)[0]
+        else:
+            if len(values) > 0:
+                content.append(list(values)[0])
+
+        msg = {"command":content}
+        print("begin to send the message...")
+        
+        try:   
+            self.cc.group_sendmsg(msg, groupName, instance)
+            print("waiting for %s reply..." % groupName)
+
+            reply, env = self.cc.group_recvmsg(False)
+            print("received reply:", reply)
         except:
             print("Error communication with %s" % groupName)
 




More information about the bind10-changes mailing list