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
c6030027
Kaydet (Commit)
c6030027
authored
May 03, 2017
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Modernize exec_api.py
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
13dfb138
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
exec_api.py
docker/api/exec_api.py
+5
-5
api_exec_test.py
tests/integration/api_exec_test.py
+2
-2
No files found.
docker/api/exec_api.py
Dosyayı görüntüle @
c6030027
...
...
@@ -35,18 +35,19 @@ class ExecApiMixin(object):
If the server returns an error.
"""
if
privileged
and
utils
.
compare_version
(
'1.19'
,
self
.
_version
)
<
0
:
if
privileged
and
utils
.
version_lt
(
self
.
_version
,
'1.19'
)
:
raise
errors
.
InvalidVersion
(
'Privileged exec is not supported in API < 1.19'
)
if
user
and
utils
.
compare_version
(
'1.19'
,
self
.
_version
)
<
0
:
if
user
and
utils
.
version_lt
(
self
.
_version
,
'1.19'
)
:
raise
errors
.
InvalidVersion
(
'User-specific exec is not supported in API < 1.19'
)
if
environment
and
utils
.
compare_version
(
'1.25'
,
self
.
_version
)
<
0
:
if
environment
is
not
None
and
utils
.
version_lt
(
self
.
_version
,
'1.25'
)
:
raise
errors
.
InvalidVersion
(
'Setting environment for exec is not supported in API < 1.25'
)
if
isinstance
(
cmd
,
six
.
string_types
):
cmd
=
utils
.
split_command
(
cmd
)
...
...
@@ -109,6 +110,7 @@ class ExecApiMixin(object):
self
.
_raise_for_status
(
res
)
@utils.minimum_version
(
'1.15'
)
@utils.check_resource
def
exec_start
(
self
,
exec_id
,
detach
=
False
,
tty
=
False
,
stream
=
False
,
socket
=
False
):
"""
...
...
@@ -130,8 +132,6 @@ class ExecApiMixin(object):
If the server returns an error.
"""
# we want opened socket if socket == True
if
isinstance
(
exec_id
,
dict
):
exec_id
=
exec_id
.
get
(
'Id'
)
data
=
{
'Tty'
:
tty
,
...
...
tests/integration/api_exec_test.py
Dosyayı görüntüle @
c6030027
...
...
@@ -132,7 +132,7 @@ class ExecTest(BaseAPIIntegrationTest):
self
.
tmp_containers
.
append
(
id
)
res
=
self
.
client
.
exec_create
(
id
,
'env'
,
environment
=
[
"X=Y"
])
self
.
assertIn
(
'Id'
,
res
)
assert
'Id'
in
res
exec_log
=
self
.
client
.
exec_start
(
res
)
self
.
assertIn
(
b
'X=Y
\n
'
,
exec_log
)
assert
b
'X=Y
\n
'
in
exec_log
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