Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
4ff29624
Kaydet (Commit)
4ff29624
authored
Ock 30, 2018
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge branch 'funkyfuture-container_exec_run'
üst
5728eebf
947c47f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
containers.py
docker/models/containers.py
+16
-6
No files found.
docker/models/containers.py
Dosyayı görüntüle @
4ff29624
import
copy
import
copy
from
collections
import
namedtuple
from
..api
import
APIClient
from
..api
import
APIClient
from
..errors
import
(
ContainerError
,
ImageNotFound
,
from
..errors
import
(
ContainerError
,
ImageNotFound
,
...
@@ -150,9 +151,10 @@ class Container(Model):
...
@@ -150,9 +151,10 @@ class Container(Model):
workdir (str): Path to working directory for this exec session
workdir (str): Path to working directory for this exec session
Returns:
Returns:
(
tuple
): A tuple of (exit_code, output)
(
ExecResult
): A tuple of (exit_code, output)
exit_code: (int):
exit_code: (int):
Exit code for the executed command
Exit code for the executed command or ``None`` if
either ``stream```or ``socket`` is ``True``.
output: (generator or str):
output: (generator or str):
If ``stream=True``, a generator yielding response chunks.
If ``stream=True``, a generator yielding response chunks.
If ``socket=True``, a socket object for the connection.
If ``socket=True``, a socket object for the connection.
...
@@ -170,10 +172,13 @@ class Container(Model):
...
@@ -170,10 +172,13 @@ class Container(Model):
exec_output
=
self
.
client
.
api
.
exec_start
(
exec_output
=
self
.
client
.
api
.
exec_start
(
resp
[
'Id'
],
detach
=
detach
,
tty
=
tty
,
stream
=
stream
,
socket
=
socket
resp
[
'Id'
],
detach
=
detach
,
tty
=
tty
,
stream
=
stream
,
socket
=
socket
)
)
exit_code
=
0
if
socket
or
stream
:
if
stream
is
False
:
return
ExecResult
(
None
,
exec_output
)
exit_code
=
self
.
client
.
api
.
exec_inspect
(
resp
[
'Id'
])[
'ExitCode'
]
return
(
exit_code
,
exec_output
)
return
ExecResult
(
self
.
client
.
api
.
exec_inspect
(
resp
[
'Id'
])[
'ExitCode'
],
exec_output
)
def
export
(
self
):
def
export
(
self
):
"""
"""
...
@@ -1004,3 +1009,8 @@ def _host_volume_from_bind(bind):
...
@@ -1004,3 +1009,8 @@ def _host_volume_from_bind(bind):
return
bits
[
0
]
return
bits
[
0
]
else
:
else
:
return
bits
[
1
]
return
bits
[
1
]
ExecResult
=
namedtuple
(
'ExecResult'
,
'exit_code,output'
)
""" A result of Container.exec_run with the properties ``exit_code`` and
``output``. """
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment