mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Wait for pipe file to be created before starting the remote console for VMware and VirtualBox VMs. Fixes #331.
This commit is contained in:
1 parent
9c23093510
commit
ee6ef9f3d5
3 files changed
+22
-1
No files matched your search
@@ -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()
|
||||
Reference in new issue
Block a user