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
f2c1ae37
Kaydet (Commit)
f2c1ae37
authored
Nis 25, 2018
tarafından
Joffrey F
Kaydeden (comit)
Joffrey F
Nis 26, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix session timeout = None case
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
2454e810
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
container.py
docker/api/container.py
+7
-8
api_container_test.py
tests/integration/api_container_test.py
+5
-7
No files found.
docker/api/container.py
Dosyayı görüntüle @
f2c1ae37
...
...
@@ -1018,9 +1018,10 @@ class ContainerApiMixin(object):
"""
params
=
{
't'
:
timeout
}
url
=
self
.
_url
(
"/containers/{0}/restart"
,
container
)
res
=
self
.
_post
(
url
,
params
=
params
,
timeout
=
timeout
+
(
self
.
timeout
or
0
)
)
conn_timeout
=
self
.
timeout
if
conn_timeout
is
not
None
:
conn_timeout
+=
timeout
res
=
self
.
_post
(
url
,
params
=
params
,
timeout
=
conn_timeout
)
self
.
_raise_for_status
(
res
)
@utils.check_resource
(
'container'
)
...
...
@@ -1110,11 +1111,9 @@ class ContainerApiMixin(object):
params
=
{
't'
:
timeout
}
url
=
self
.
_url
(
"/containers/{0}/stop"
,
container
)
conn_timeout
=
self
.
timeout
if
conn_timeout
:
conn_timeout
=
max
(
conn_timeout
,
timeout
+
15
)
res
=
self
.
_post
(
url
,
params
=
params
,
timeout
=
timeout
+
(
self
.
timeout
or
0
)
)
if
conn_timeout
is
not
None
:
conn_timeout
+=
timeout
res
=
self
.
_post
(
url
,
params
=
params
,
timeout
=
conn_timeout
)
self
.
_raise_for_status
(
res
)
@utils.check_resource
(
'container'
)
...
...
tests/integration/api_container_test.py
Dosyayı görüntüle @
f2c1ae37
...
...
@@ -1165,16 +1165,14 @@ class RestartContainerTest(BaseAPIIntegrationTest):
assert
info2
[
'State'
][
'Running'
]
is
True
self
.
client
.
kill
(
id
)
def
test_restart_with_
high
_timeout
(
self
):
def
test_restart_with_
low
_timeout
(
self
):
container
=
self
.
client
.
create_container
(
BUSYBOX
,
[
'sleep'
,
'9999'
])
id
=
container
[
'Id'
]
self
.
client
.
start
(
id
)
self
.
client
.
start
(
container
)
self
.
client
.
timeout
=
1
self
.
client
.
restart
(
id
,
timeout
=
3
)
self
.
client
.
restart
(
container
,
timeout
=
3
)
self
.
client
.
timeout
=
None
self
.
client
.
restart
(
id
,
timeout
=
3
)
self
.
client
.
timeout
=
1
self
.
client
.
stop
(
id
,
timeout
=
3
)
self
.
client
.
restart
(
container
,
timeout
=
3
)
self
.
client
.
kill
(
container
)
def
test_restart_with_dict_instead_of_id
(
self
):
container
=
self
.
client
.
create_container
(
BUSYBOX
,
[
'sleep'
,
'9999'
])
...
...
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