[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r18069: {torctl} Remove routers that no longer have the running flag from our (torctl/trunk/python/TorCtl)



Author: mikeperry
Date: 2009-01-10 20:35:19 -0500 (Sat, 10 Jan 2009)
New Revision: 18069

Modified:
   torctl/trunk/python/TorCtl/PathSupport.py
Log:

Remove routers that no longer have the running flag from our
router lists.



Modified: torctl/trunk/python/TorCtl/PathSupport.py
===================================================================
--- torctl/trunk/python/TorCtl/PathSupport.py	2009-01-11 01:31:39 UTC (rev 18068)
+++ torctl/trunk/python/TorCtl/PathSupport.py	2009-01-11 01:35:19 UTC (rev 18069)
@@ -1030,6 +1030,15 @@
       delay_job(self)
 
   def read_routers(self, nslist):
+    for ns in nslist:
+      if not "Running" in ns.flags:
+        if ns.idhex in self.routers:
+          plog("DEBUG", "Expiring non-running router "+r.idhex)
+          self.sorted_r.remove(elf.routers[ns.idhex])
+          del self.routers[ns.idhex]
+
+    nslist = filter(lambda ns: "Running" in ns.flags, nslist)
+  
     routers = self.c.read_routers(nslist)
     new_routers = []
     for r in routers: