mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Retry listing of running VMs to handle transitory failures
This commit is contained in:
parent
84af615192
commit
e723ec4c47
@ -26,7 +26,12 @@ def get_rsync_pw():
|
||||
|
||||
def is_vm_running(name):
|
||||
qname = '"%s"' % name
|
||||
for line in subprocess.check_output('VBoxManage list runningvms'.split()).decode('utf-8').splitlines():
|
||||
try:
|
||||
lines = subprocess.check_output('VBoxManage list runningvms'.split()).decode('utf-8').splitlines()
|
||||
except Exception:
|
||||
time.sleep(1)
|
||||
lines = subprocess.check_output('VBoxManage list runningvms'.split()).decode('utf-8').splitlines()
|
||||
for line in lines:
|
||||
if line.startswith(qname):
|
||||
return True
|
||||
return False
|
||||
|
Loading…
x
Reference in New Issue
Block a user