File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -198,9 +198,9 @@ def __init__(self, maxSecs: int=20) -> None:
198198 self .sleepInterval : float = 0.1
199199 self .expireTimeout : int = maxSecs
200200
201- def reset (self ) -> None :
201+ def reset (self , expireTimeout = None ) :
202202 """Restart the waitForSet timer"""
203- self .expireTime = time .time () + self .expireTimeout
203+ self .expireTime = time .time () + ( self .expireTimeout if expireTimeout is None else expireTimeout )
204204
205205 def waitForSet (self , target , attrs = ()) -> bool :
206206 """Block until the specified attributes are set. Returns True if config has been received."""
@@ -225,8 +225,7 @@ def waitForAckNak(
225225
226226 def waitForTraceRoute (self , waitFactor , acknowledgment , attr = "receivedTraceRoute" ) -> bool :
227227 """Block until traceroute response is received. Returns True if traceroute response has been received."""
228- self .expireTimeout *= waitFactor
229- self .reset ()
228+ self .reset (self .expireTimeout * waitFactor )
230229 while time .time () < self .expireTime :
231230 if getattr (acknowledgment , attr , None ):
232231 acknowledgment .reset ()
You can’t perform that action at this time.
0 commit comments