Wait for pipe file to be created before starting the remote console for VMware and VirtualBox VMs. Fixes #331.

This commit is contained in:
grossmj committed 2015-10-11 15:50:50 -06:00
1 parent 9c23093510
commit ee6ef9f3d5
3 files changed
+22 -1

No files matched your search

+12
View File
@@ -18,6 +18,7 @@
import asyncio
import sys
import os
@asyncio.coroutine
@@ -96,3 +97,14 @@ def monitor_process(process, termination_callback):
"""Call termination_callback when a process dies"""
asyncio.async(_check_process(process, termination_callback))
@asyncio.coroutine
def wait_for_file_creation(path, timeout=10):
while timeout > 0:
if os.path.exists(path):
return
yield from asyncio.sleep(0.5)
timeout -= 0.5
raise asyncio.TimeoutError()