Fix permissions and ownership when stopping container

Fix #550
This commit is contained in:
Julien Duponchelle committed 2016-05-31 21:08:41 +02:00
1 parent 6f7b06e66f
commit d3436756b2
6 files changed
+52 -7

No files matched your search

+4 -2
View File
@@ -16,24 +16,26 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import functools
import asyncio
import sys
import os
@asyncio.coroutine
def wait_run_in_executor(func, *args):
def wait_run_in_executor(func, *args, **kwargs):
"""
Run blocking code in a different thread and wait
for the result.
:param func: Run this function in a different thread
:param args: Parameters of the function
:param kwargs: Keyword parameters of the function
:returns: Return the result of the function
"""
loop = asyncio.get_event_loop()
future = loop.run_in_executor(None, func, *args)
future = loop.run_in_executor(None, functools.partial(func, *args, **kwargs))
yield from asyncio.wait([future])
return future.result()