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
3bd053a4
Kaydet (Commit)
3bd053a4
authored
Kas 07, 2017
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add unlock methods to Swarm model
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
aa3c4f02
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
swarm.py
docker/models/swarm.py
+8
-0
swarm.rst
docs/swarm.rst
+2
-0
api_swarm_test.py
tests/integration/api_swarm_test.py
+6
-5
No files found.
docker/models/swarm.py
Dosyayı görüntüle @
3bd053a4
...
...
@@ -29,6 +29,10 @@ class Swarm(Model):
"""
return
self
.
attrs
.
get
(
'Version'
)
.
get
(
'Index'
)
def
get_unlock_key
(
self
):
return
self
.
client
.
api
.
get_unlock_key
()
get_unlock_key
.
__doc__
=
APIClient
.
get_unlock_key
.
__doc__
def
init
(
self
,
advertise_addr
=
None
,
listen_addr
=
'0.0.0.0:2377'
,
force_new_cluster
=
False
,
**
kwargs
):
"""
...
...
@@ -128,6 +132,10 @@ class Swarm(Model):
"""
self
.
attrs
=
self
.
client
.
api
.
inspect_swarm
()
def
unlock
(
self
,
key
):
return
self
.
client
.
api
.
unlock_swarm
(
key
)
unlock
.
__doc__
=
APIClient
.
unlock_swarm
.
__doc__
def
update
(
self
,
rotate_worker_token
=
False
,
rotate_manager_token
=
False
,
**
kwargs
):
"""
...
...
docs/swarm.rst
Dosyayı görüntüle @
3bd053a4
...
...
@@ -12,9 +12,11 @@ These methods are available on ``client.swarm``:
.. rst-class:: hide-signature
.. py:class:: Swarm
.. automethod:: get_unlock_key()
.. automethod:: init()
.. automethod:: join()
.. automethod:: leave()
.. automethod:: unlock()
.. automethod:: update()
.. automethod:: reload()
...
...
tests/integration/api_swarm_test.py
Dosyayı görüntüle @
3bd053a4
...
...
@@ -10,13 +10,13 @@ class SwarmTest(BaseAPIIntegrationTest):
def
setUp
(
self
):
super
(
SwarmTest
,
self
)
.
setUp
()
force_leave_swarm
(
self
.
client
)
self
.
_unlock_key
=
None
def
tearDown
(
self
):
super
(
SwarmTest
,
self
)
.
tearDown
()
try
:
unlock_key
=
self
.
client
.
get_unlock_key
()
if
unlock_key
.
get
(
'UnlockKey'
):
self
.
unlock_swarm
(
unlock_key
)
if
self
.
_unlock_key
:
self
.
client
.
unlock_swarm
(
self
.
_unlock_key
)
except
docker
.
errors
.
APIError
:
pass
...
...
@@ -71,14 +71,15 @@ class SwarmTest(BaseAPIIntegrationTest):
def
test_init_swarm_with_autolock_managers
(
self
):
spec
=
self
.
client
.
create_swarm_spec
(
autolock_managers
=
True
)
assert
self
.
init_swarm
(
swarm_spec
=
spec
)
# save unlock key for tearDown
self
.
_unlock_key
=
self
.
client
.
get_unlock_key
()
swarm_info
=
self
.
client
.
inspect_swarm
()
assert
(
swarm_info
[
'Spec'
][
'EncryptionConfig'
][
'AutoLockManagers'
]
is
True
)
unlock_key
=
self
.
get_unlock_key
()
assert
unlock_key
.
get
(
'UnlockKey'
)
assert
self
.
_unlock_key
.
get
(
'UnlockKey'
)
@requires_api_version
(
'1.25'
)
@pytest.mark.xfail
(
...
...
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