mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-16 08:05:39 +01:00
Retry listing of running VMs to handle transitory failures
This commit is contained in:
parent
84af615192
commit
e723ec4c47
1 changed files with 6 additions and 1 deletions
|
|
@ -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…
Reference in a new issue