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
7b3b83df
Kaydet (Commit)
7b3b83df
authored
Kas 28, 2018
tarafından
Corentin Henry
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix exec api inconsistency
Signed-off-by:
Corentin Henry
<
corentinhenry@gmail.com
>
üst
41c0eb7e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
socket.py
docker/utils/socket.py
+9
-3
api_exec_test.py
tests/integration/api_exec_test.py
+1
-1
api_test.py
tests/unit/api_test.py
+1
-1
No files found.
docker/utils/socket.py
Dosyayı görüntüle @
7b3b83df
...
...
@@ -138,15 +138,21 @@ def consume_socket_output(frames, demux=False):
# If the streams are demultiplexed, the generator yields tuples
# (stdout, stderr)
out
=
[
six
.
binary_type
(),
six
.
binary_type
()
]
out
=
[
None
,
None
]
for
frame
in
frames
:
# It is guaranteed that for each frame, one and only one stream
# is not None.
assert
frame
!=
(
None
,
None
)
if
frame
[
0
]
is
not
None
:
out
[
0
]
+=
frame
[
0
]
if
out
[
0
]
is
None
:
out
[
0
]
=
frame
[
0
]
else
:
out
[
0
]
+=
frame
[
0
]
else
:
out
[
1
]
+=
frame
[
1
]
if
out
[
1
]
is
None
:
out
[
1
]
=
frame
[
1
]
else
:
out
[
1
]
+=
frame
[
1
]
return
tuple
(
out
)
...
...
tests/integration/api_exec_test.py
Dosyayı görüntüle @
7b3b83df
...
...
@@ -134,7 +134,7 @@ class ExecTest(BaseAPIIntegrationTest):
# tty=True, stream=False, demux=True
res
=
self
.
client
.
exec_create
(
id
,
cmd
,
tty
=
True
)
exec_log
=
self
.
client
.
exec_start
(
res
,
demux
=
True
)
assert
exec_log
==
(
b
'hello out
\r\n
hello err
\r\n
'
,
b
''
)
assert
exec_log
==
(
b
'hello out
\r\n
hello err
\r\n
'
,
None
)
# tty=True, stream=True, demux=True
res
=
self
.
client
.
exec_create
(
id
,
cmd
,
tty
=
True
)
...
...
tests/unit/api_test.py
Dosyayı görüntüle @
7b3b83df
...
...
@@ -574,7 +574,7 @@ class TCPSocketStreamTest(unittest.TestCase):
def
test_read_from_socket_6
(
self
):
res
=
self
.
request
(
stream
=
False
,
tty
=
True
,
demux
=
True
)
assert
res
==
(
self
.
stdout_data
+
self
.
stderr_data
,
b
''
)
assert
res
==
(
self
.
stdout_data
+
self
.
stderr_data
,
None
)
def
test_read_from_socket_7
(
self
):
res
=
self
.
request
(
stream
=
False
,
tty
=
False
,
demux
=
False
)
...
...
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