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

[or-cvs] r18151: {torctl} It compiles, it must work. (torctl/trunk/python/TorCtl)



Author: mikeperry
Date: 2009-01-17 05:46:35 -0500 (Sat, 17 Jan 2009)
New Revision: 18151

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

It compiles, it must work.



Modified: torctl/trunk/python/TorCtl/PathSupport.py
===================================================================
--- torctl/trunk/python/TorCtl/PathSupport.py	2009-01-17 09:56:12 UTC (rev 18150)
+++ torctl/trunk/python/TorCtl/PathSupport.py	2009-01-17 10:46:35 UTC (rev 18151)
@@ -71,6 +71,10 @@
   "Error raised for issues with applying restrictions"
   pass
 
+class NoNodesRemain(RestrictionError):
+  "Error raised for issues with applying restrictions"
+  pass
+
 class NodeRestriction:
   "Interface for node restriction policies"
   def r_is_ok(self, r):
@@ -150,7 +154,7 @@
     self.routers = copy.copy(self.rstr_routers)
     if not self.routers:
       plog("ERROR", "No routers left after restrictions applied!")
-      raise RestrictionError()
+      raise NoNodesRemain()
  
   def rebuild(self, sorted_r=None):
     """ Extra step to be performed when new routers are added or when
@@ -160,7 +164,7 @@
     self.rstr_routers = filter(lambda r: self.rstr_list.r_is_ok(r), self.sorted_r)
     if not self.rstr_routers:
       plog("ERROR", "No routers left after restrictions applied!")
-      raise RestrictionError()
+      raise NoNodesRemain()
 
   def mark_chosen(self, r):
     """Mark a router as chosen: remove it from the list of routers