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
acd7a8f4
Kaydet (Commit)
acd7a8f4
authored
Mar 28, 2019
tarafından
Hannes Ljungberg
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Return node id on swarm init
Signed-off-by:
Hannes Ljungberg
<
hannes@5monkeys.se
>
üst
992e0dcd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
swarm.py
docker/api/swarm.py
+2
-3
swarm.py
docker/models/swarm.py
+3
-3
api_swarm_test.py
tests/integration/api_swarm_test.py
+3
-1
No files found.
docker/api/swarm.py
Dosyayı görüntüle @
acd7a8f4
...
...
@@ -117,7 +117,7 @@ class SwarmApiMixin(object):
networks created from the default subnet pool. Default: None
Returns:
``True`` if successful
.
(str): The ID of the created node
.
Raises:
:py:class:`docker.errors.APIError`
...
...
@@ -155,8 +155,7 @@ class SwarmApiMixin(object):
'Spec'
:
swarm_spec
,
}
response
=
self
.
_post_json
(
url
,
data
=
data
)
self
.
_raise_for_status
(
response
)
return
True
return
self
.
_result
(
response
,
json
=
True
)
@utils.minimum_version
(
'1.24'
)
def
inspect_swarm
(
self
):
...
...
docker/models/swarm.py
Dosyayı görüntüle @
acd7a8f4
...
...
@@ -96,7 +96,7 @@ class Swarm(Model):
created in the orchestrator.
Returns:
``True`` if the request went through
.
(str): The ID of the created node
.
Raises:
:py:class:`docker.errors.APIError`
...
...
@@ -120,9 +120,9 @@ class Swarm(Model):
'subnet_size'
:
subnet_size
}
init_kwargs
[
'swarm_spec'
]
=
self
.
client
.
api
.
create_swarm_spec
(
**
kwargs
)
self
.
client
.
api
.
init_swarm
(
**
init_kwargs
)
node_id
=
self
.
client
.
api
.
init_swarm
(
**
init_kwargs
)
self
.
reload
()
return
True
return
node_id
def
join
(
self
,
*
args
,
**
kwargs
):
return
self
.
client
.
api
.
join_swarm
(
*
args
,
**
kwargs
)
...
...
tests/integration/api_swarm_test.py
Dosyayı görüntüle @
acd7a8f4
...
...
@@ -186,12 +186,14 @@ class SwarmTest(BaseAPIIntegrationTest):
@requires_api_version
(
'1.24'
)
def
test_inspect_node
(
self
):
assert
self
.
init_swarm
()
node_id
=
self
.
init_swarm
()
assert
node_id
nodes_list
=
self
.
client
.
nodes
()
assert
len
(
nodes_list
)
==
1
node
=
nodes_list
[
0
]
node_data
=
self
.
client
.
inspect_node
(
node
[
'ID'
])
assert
node
[
'ID'
]
==
node_data
[
'ID'
]
assert
node_id
==
node
[
'ID'
]
assert
node
[
'Version'
]
==
node_data
[
'Version'
]
@requires_api_version
(
'1.24'
)
...
...
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