[svn] commit: r2933 - in /branches/trac312/src: bin/xfrout/xfrout.py.in lib/python/isc/cc/session.py

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Sep 15 14:35:21 UTC 2010


Author: jelte
Date: Wed Sep 15 14:35:21 2010
New Revision: 2933

Log:
changed print() calls in xfrout to sys.stderr.write
added an assertion check to _receive_full_buffer

Modified:
    branches/trac312/src/bin/xfrout/xfrout.py.in
    branches/trac312/src/lib/python/isc/cc/session.py

Modified: branches/trac312/src/bin/xfrout/xfrout.py.in
==============================================================================
--- branches/trac312/src/bin/xfrout/xfrout.py.in (original)
+++ branches/trac312/src/bin/xfrout/xfrout.py.in Wed Sep 15 14:35:21 2010
@@ -315,8 +315,8 @@
         If it's not a socket file or nobody is listening
         , it will be removed. If it can't be removed, exit from python. '''
         if self._sock_file_in_use(sock_file):
-            print("[b10-xfrout] Fail to start xfrout process, unix socket" 
-                  " file '%s' is being used by another xfrout process" % sock_file)
+            sys.stderr.write("[b10-xfrout] Fail to start xfrout process, unix socket" 
+                  " file '%s' is being used by another xfrout process\n" % sock_file)
             sys.exit(0)
         else:
             if not os.path.exists(sock_file):
@@ -325,7 +325,7 @@
             try:
                 os.unlink(sock_file)
             except OSError as err:
-                print('[b10-xfrout] Fail to remove file ' + sock_file, err)
+                sys.stderr.write('[b10-xfrout] Fail to remove file %s: %s' % (sock_file, err))
                 sys.exit(0)
    
     def _sock_file_in_use(self, sock_file):
@@ -527,10 +527,10 @@
     except KeyboardInterrupt:
         sys.stderr.write("[b10-xfrout] exit xfrout process")
     except SessionError as e:
-        sys.stderr.write("[b10-xfrout] Error creating xfrout," 
+        sys.stderr.write("[b10-xfrout] Error creating xfrout, "
                            "is the command channel daemon running?")
     except SessionTimeout as e:
-        sys.stderr.write("[b10-xfrout] Error creating xfrout," 
+        sys.stderr.write("[b10-xfrout] Error creating xfrout, " 
                            "is the configuration manager running?")
     except ModuleCCSessionError as e:
         sys.stderr.write("info", '[b10-xfrout] exit xfrout process:', e)

Modified: branches/trac312/src/lib/python/isc/cc/session.py
==============================================================================
--- branches/trac312/src/lib/python/isc/cc/session.py (original)
+++ branches/trac312/src/lib/python/isc/cc/session.py Wed Sep 15 14:35:21 2010
@@ -173,6 +173,10 @@
             # we might be in a call following an EAGAIN, in which case
             # we simply continue. In the first case, either
             # recv_size or recv_len size are not zero
+            # they may never both be non-zero (we are either starting
+            # a full read, or continuing one of the reads
+            assert self._recv_size == 0 or self._recv_len_size == 0
+            
             if self._recv_size == 0:
                 if self._recv_len_size == 0:
                     # both zero, start a new full read




More information about the bind10-changes mailing list