mirror of https://github.com/docker/docker-py.git
Merge e02904c964
into db7f8b8bb6
This commit is contained in:
commit
4cf0df797d
|
@ -215,6 +215,12 @@ class Container(Model):
|
||||||
resp['Id'], detach=detach, tty=tty, stream=stream, socket=socket,
|
resp['Id'], detach=detach, tty=tty, stream=stream, socket=socket,
|
||||||
demux=demux
|
demux=demux
|
||||||
)
|
)
|
||||||
|
if detach:
|
||||||
|
return ExecDetachResult(
|
||||||
|
resp["Id"],
|
||||||
|
self.client.api.exec_inspect(resp["Id"])["ExitCode"],
|
||||||
|
self.client.api.exec_inspect(resp["Id"])["Running"],
|
||||||
|
)
|
||||||
if socket or stream:
|
if socket or stream:
|
||||||
return ExecResult(None, exec_output)
|
return ExecResult(None, exec_output)
|
||||||
|
|
||||||
|
@ -1196,3 +1202,6 @@ def _host_volume_from_bind(bind):
|
||||||
ExecResult = namedtuple('ExecResult', 'exit_code,output')
|
ExecResult = namedtuple('ExecResult', 'exit_code,output')
|
||||||
""" A result of Container.exec_run with the properties ``exit_code`` and
|
""" A result of Container.exec_run with the properties ``exit_code`` and
|
||||||
``output``. """
|
``output``. """
|
||||||
|
ExecDetachResult = namedtuple('ExecDetachResult', 'id,exit_code,status')
|
||||||
|
""" A result of Container.exec_run in detached mode
|
||||||
|
with the properties ``id``, ``exit_code`` and ``status``. """
|
||||||
|
|
Loading…
Reference in New Issue