3
3
from ..api import APIClient
4
4
from ..errors import (ContainerError , ImageNotFound ,
5
5
create_unexpected_kwargs_error )
6
- from ..types import HostConfig
6
+ from ..types import ExecResult , HostConfig
7
7
from ..utils import version_gte
8
8
from .images import Image
9
9
from .resource import Collection , Model
@@ -150,7 +150,7 @@ def exec_run(self, cmd, stdout=True, stderr=True, stdin=False, tty=False,
150
150
workdir (str): Path to working directory for this exec session
151
151
152
152
Returns:
153
- (tuple ): A tuple of (exit_code, output)
153
+ (ExecResult ): A tuple of (exit_code, output)
154
154
exit_code: (int):
155
155
Exit code for the executed command or ``None`` if
156
156
either ``stream```or ``socket`` is ``True``.
@@ -172,10 +172,11 @@ def exec_run(self, cmd, stdout=True, stderr=True, stdin=False, tty=False,
172
172
resp ['Id' ], detach = detach , tty = tty , stream = stream , socket = socket
173
173
)
174
174
if socket or stream :
175
- return None , exec_output
175
+ return ExecResult ( None , exec_output )
176
176
else :
177
- return (self .client .api .exec_inspect (resp ['Id' ])['ExitCode' ],
178
- exec_output )
177
+ return ExecResult (
178
+ self .client .api .exec_inspect (resp ['Id' ])['ExitCode' ],
179
+ exec_output )
179
180
180
181
def export (self ):
181
182
"""
0 commit comments