[svn] commit: r567 - in /branches/parkinglot/src/bin/bind10: bind10.in bind10.py bob.spec

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Jan 27 19:54:41 UTC 2010


Author: jelte
Date: Wed Jan 27 19:54:40 2010
New Revision: 567

Log:
'stub' call to CCSession from bob, and mini-sample-specfile

Added:
    branches/parkinglot/src/bin/bind10/bob.spec
Modified:
    branches/parkinglot/src/bin/bind10/bind10.in
    branches/parkinglot/src/bin/bind10/bind10.py

Modified: branches/parkinglot/src/bin/bind10/bind10.in
==============================================================================
--- branches/parkinglot/src/bin/bind10/bind10.in (original)
+++ branches/parkinglot/src/bin/bind10/bind10.in Wed Jan 27 19:54:40 2010
@@ -8,7 +8,7 @@
 PATH=@abs_top_srcdir@/src/bin/msgq:@abs_top_srcdir@/src/bin/parkinglot:@abs_top_srcdir@/src/bin/bind-cfgd:@abs_top_srcdir@/src/bin/cmd-ctrld:$PATH
 export PATH
 
-PYTHONPATH=@abs_top_srcdir@/src/lib/cc/python:${abs_top_src_dir}/lib/cc/python/ISC
+PYTHONPATH=@abs_top_srcdir@/src/lib/cc/python:@abs_top_srcdir@/src/lib/config/python
 export PYTHONPATH
 
 cd ${BIND10_PATH}

Modified: branches/parkinglot/src/bin/bind10/bind10.py
==============================================================================
--- branches/parkinglot/src/bin/bind10/bind10.py (original)
+++ branches/parkinglot/src/bin/bind10/bind10.py Wed Jan 27 19:54:40 2010
@@ -33,6 +33,7 @@
 from optparse import OptionParser, OptionValueError
 
 import ISC.CC
+import isc
 
 # This is the version that gets displayed to the user.
 __version__ = "v20091030 (Paving the DNS Parking Lot)"
@@ -88,6 +89,17 @@
         self.dead_processes = {}
         self.runnable = False
 
+    def config_handler(self, new_config):
+        if self.verbose:
+            print("[XX] handling new config:")
+            print(new_config)
+
+    def command_handler(self, command):
+        if self.verbose:
+            print("[XX] Boss got command:")
+            print(command)
+        return None
+    
     def startup(self):
         """Start the BoB instance.
  
@@ -133,6 +145,17 @@
         if self.verbose:
             sys.stdout.write("Started bind-cfgd (PID %d)\n" % bind_cfgd.pid)
 
+        # TODO: once this interface is done, replace self.cc_session
+        # by this one
+        # sleep until bind-cfgd is fully up and running, this is a good place
+        # to have a (short) timeout on synchronized groupsend/receive
+        time.sleep(1)
+        if self.verbose:
+            print("[XX] starting ccsession")
+        self.ccs = isc.config.CCSession("bob", "bob.spec", self.config_handler, self.command_handler)
+        if self.verbose:
+            print("[XX] ccsession started")
+
         # start the parking lot
         # XXX: this must be read from the configuration manager in the future
         # XXX: we hardcode port 5300
@@ -164,6 +187,7 @@
             sys.stdout.write("Started cmd-ctrld (PID %d)\n" % cmd_ctrld.pid)
 
         self.runnable = True
+
         return None
 
     def stop_all_processes(self):




More information about the bind10-changes mailing list