Skip to content

Commit 2110c9d

Browse files
committed
wait.. fix
1 parent c768f9d commit 2110c9d

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

scan/client/scanclient.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff 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

scan/version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

2-
__version__ = '1.5.5'
2+
__version__ = '1.5.6'
33

44
version_history = """
5+
1.5.6 - wait..() fix
56
1.5.5 - scanInfo() time out
67
1.5.4 - Add '!=' to If() and Wait()
78
1.5.3 - Fix 'id' vs. 'scanID' in patch()

0 commit comments

Comments
 (0)