chiark / gitweb /
better document routing assistance
[hippotat.git] / hippotatlib / __init__.py
index 19a6aef3c26bab94ba00585d51c9a0d2c55c5134..9b2c33db0aa2efce154855281cc9c21edd6b4fc1 100644 (file)
@@ -390,12 +390,17 @@ def _cfg_process_putatives():
         server_pat + r' ' + '(?:' + client_pat + '|LIMIT)')
 
   for cs in cfg.sections():
+    def dbg(m):
+      log_debug_config('putatives: section [%s] %s' % (cs, m))
+
     def log_ignore(why):
+      dbg('X ignore: %s' % (why))
       print('warning: ignoring config section [%s] (%s)' % (cs, why),
             file=sys.stderr)
 
     if cs == 'LIMIT' or cs == 'COMMON':
       # plan A "[LIMIT]" or "[COMMON]"
+      dbg('A ignore')
       continue
 
     try:
@@ -405,6 +410,7 @@ def _cfg_process_putatives():
 
       if server_re.fullmatch(cs):
         # plan C "[<servername>]"
+        dbg('C <server>')
         putative(servers, cs, cs)
         continue
 
@@ -414,24 +420,30 @@ def _cfg_process_putatives():
 
         if pcs == 'LIMIT':
           # plan E "[<servername> LIMIT]"
+          dbg('E <server> LIMIT')
           continue
 
         try:
           # plan D "[<servername> <client>]" part 2
-          ci = ipaddr(pc)
+          ci = ipaddr(pcs)
         except AddressValueError:
-          # plan F "[<some thing we do not understand>]"
+          # plan F branch 1 "[<some thing we do not understand>]"
           log_ignore('bad-addr')
           continue
 
         else: # no AddressValueError
-          # plan D "[<servername> <client]" part 3
+          # plan D "[<servername> <client>]" part 3
+          dbg('D <server> <client>')
           putative(clients, ci, pcs)
           putative(servers, pss, pss)
           continue
+      else:
+        # plan F branch 2 "[<some thing we do not understand>]"
+        log_ignore('nomatch '+ repr(serverclient_re))
 
     else: # no AddressValueError
       # plan B "[<client>" part 2
+      dbg('B <client>')
       putative(clients, ci, cs)
       continue