File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -375,6 +375,13 @@ def scanDevices(self, scanID=-1):
375375 xml = perform_request (url )
376376 return xml
377377
378+ def __getInfo (self , scanID ):
379+ """Keep getting scan info while disconnected/timed out"""
380+ while True :
381+ try :
382+ return self .scanInfo (scanID )
383+ except :
384+ time .sleep (1 )
378385
379386 def waitUntilDone (self , scanID ):
380387 """Wait until scan finishes.
@@ -396,14 +403,11 @@ def waitUntilDone(self, scanID):
396403 :raise Exception: If scan was aborted or failed.
397404 """
398405 while True :
399- try :
400- info = self .scanInfo (scanID )
401- if info .state in ( 'Aborted' , 'Failed' ):
402- raise Exception (str (info ))
403- if info .isDone ():
404- return info
405- except :
406- pass
406+ info = self .__getInfo (scanID )
407+ if info .state in ( 'Aborted' , 'Failed' ):
408+ raise Exception (str (info ))
409+ if info .isDone ():
410+ return info
407411 time .sleep (1 )
408412
409413
Original file line number Diff line number Diff line change 11
2- __version__ = '1.5.5 '
2+ __version__ = '1.5.6 '
33
44version_history = """
5+ 1.5.6 - wait..() fix
561.5.5 - scanInfo() time out
671.5.4 - Add '!=' to If() and Wait()
781.5.3 - Fix 'id' vs. 'scanID' in patch()
You can’t perform that action at this time.
0 commit comments