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
827bd98d
Kaydet (Commit)
827bd98d
authored
Nis 25, 2018
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge branch 'master' of github.com:docker/docker-py
üst
c6c45d9c
ae8f7773
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
10 deletions
+23
-10
config.py
docker/api/config.py
+4
-4
container.py
docker/api/container.py
+8
-4
api_container_test.py
tests/integration/api_container_test.py
+9
-0
api_container_test.py
tests/unit/api_container_test.py
+2
-2
No files found.
docker/api/config.py
Dosyayı görüntüle @
827bd98d
...
...
@@ -6,7 +6,7 @@ from .. import utils
class
ConfigApiMixin
(
object
):
@utils.minimum_version
(
'1.
25
'
)
@utils.minimum_version
(
'1.
30
'
)
def
create_config
(
self
,
name
,
data
,
labels
=
None
):
"""
Create a config
...
...
@@ -35,7 +35,7 @@ class ConfigApiMixin(object):
self
.
_post_json
(
url
,
data
=
body
),
True
)
@utils.minimum_version
(
'1.
25
'
)
@utils.minimum_version
(
'1.
30
'
)
@utils.check_resource
(
'id'
)
def
inspect_config
(
self
,
id
):
"""
...
...
@@ -53,7 +53,7 @@ class ConfigApiMixin(object):
url
=
self
.
_url
(
'/configs/{0}'
,
id
)
return
self
.
_result
(
self
.
_get
(
url
),
True
)
@utils.minimum_version
(
'1.
25
'
)
@utils.minimum_version
(
'1.
30
'
)
@utils.check_resource
(
'id'
)
def
remove_config
(
self
,
id
):
"""
...
...
@@ -73,7 +73,7 @@ class ConfigApiMixin(object):
self
.
_raise_for_status
(
res
)
return
True
@utils.minimum_version
(
'1.
25
'
)
@utils.minimum_version
(
'1.
30
'
)
def
configs
(
self
,
filters
=
None
):
"""
List configs
...
...
docker/api/container.py
Dosyayı görüntüle @
827bd98d
...
...
@@ -1018,7 +1018,10 @@ class ContainerApiMixin(object):
"""
params
=
{
't'
:
timeout
}
url
=
self
.
_url
(
"/containers/{0}/restart"
,
container
)
res
=
self
.
_post
(
url
,
params
=
params
)
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'
)
...
...
@@ -1107,9 +1110,10 @@ class ContainerApiMixin(object):
else
:
params
=
{
't'
:
timeout
}
url
=
self
.
_url
(
"/containers/{0}/stop"
,
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'
)
...
...
tests/integration/api_container_test.py
Dosyayı görüntüle @
827bd98d
...
...
@@ -1165,6 +1165,15 @@ class RestartContainerTest(BaseAPIIntegrationTest):
assert
info2
[
'State'
][
'Running'
]
is
True
self
.
client
.
kill
(
id
)
def
test_restart_with_low_timeout
(
self
):
container
=
self
.
client
.
create_container
(
BUSYBOX
,
[
'sleep'
,
'9999'
])
self
.
client
.
start
(
container
)
self
.
client
.
timeout
=
1
self
.
client
.
restart
(
container
,
timeout
=
3
)
self
.
client
.
timeout
=
None
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'
])
assert
'Id'
in
container
...
...
tests/unit/api_container_test.py
Dosyayı görüntüle @
827bd98d
...
...
@@ -1335,7 +1335,7 @@ class ContainerTest(BaseAPIClientTest):
'POST'
,
url_prefix
+
'containers/3cc2351ab11b/restart'
,
params
=
{
't'
:
2
},
timeout
=
DEFAULT_TIMEOUT_SECONDS
timeout
=
(
DEFAULT_TIMEOUT_SECONDS
+
2
)
)
def
test_restart_container_with_dict_instead_of_id
(
self
):
...
...
@@ -1345,7 +1345,7 @@ class ContainerTest(BaseAPIClientTest):
'POST'
,
url_prefix
+
'containers/3cc2351ab11b/restart'
,
params
=
{
't'
:
2
},
timeout
=
DEFAULT_TIMEOUT_SECONDS
timeout
=
(
DEFAULT_TIMEOUT_SECONDS
+
2
)
)
def
test_remove_container
(
self
):
...
...
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