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
b71f34e9
Kaydet (Commit)
b71f34e9
authored
Ara 06, 2016
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix typo in create_network
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
2b85fbf1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
network.py
docker/api/network.py
+5
-4
api_network_test.py
tests/integration/api_network_test.py
+11
-0
No files found.
docker/api/network.py
Dosyayı görüntüle @
b71f34e9
...
...
@@ -38,7 +38,7 @@ class NetworkApiMixin(object):
@minimum_version
(
'1.21'
)
def
create_network
(
self
,
name
,
driver
=
None
,
options
=
None
,
ipam
=
None
,
check_duplicate
=
None
,
internal
=
False
,
labels
=
None
,
enable_ipv6
=
False
,
attachable
=
None
):
enable_ipv6
=
False
,
attachable
=
None
,
scope
=
None
):
"""
Create a network. Similar to the ``docker network create``.
...
...
@@ -119,10 +119,11 @@ class NetworkApiMixin(object):
'supported in API version < 1.22'
)
data
[
'Internal'
]
=
True
if
attachable
is
not
None
if
attachable
is
not
None
:
if
version_lt
(
self
.
_version
,
'1.24'
):
raise
InvalidVersion
(
'Attachable is not '
'supported in API version < 1.24'
)
raise
InvalidVersion
(
'attachable is not supported in API version < 1.24'
)
data
[
'Attachable'
]
=
attachable
url
=
self
.
_url
(
"/networks/create"
)
...
...
tests/integration/api_network_test.py
Dosyayı görüntüle @
b71f34e9
...
...
@@ -7,6 +7,10 @@ from .base import BaseAPIIntegrationTest
class
TestNetworks
(
BaseAPIIntegrationTest
):
def
tearDown
(
self
):
super
(
TestNetworks
,
self
)
.
tearDown
()
self
.
client
.
leave_swarm
(
force
=
True
)
def
create_network
(
self
,
*
args
,
**
kwargs
):
net_name
=
random_name
()
net_id
=
self
.
client
.
create_network
(
net_name
,
*
args
,
**
kwargs
)[
'Id'
]
...
...
@@ -434,3 +438,10 @@ class TestNetworks(BaseAPIIntegrationTest):
_
,
net_id
=
self
.
create_network
(
enable_ipv6
=
True
)
net
=
self
.
client
.
inspect_network
(
net_id
)
assert
net
[
'EnableIPv6'
]
is
True
@requires_api_version
(
'1.24'
)
def
test_create_network_attachable
(
self
):
assert
self
.
client
.
init_swarm
(
'eth0'
)
_
,
net_id
=
self
.
create_network
(
driver
=
'overlay'
,
attachable
=
True
)
net
=
self
.
client
.
inspect_network
(
net_id
)
assert
net
[
'Attachable'
]
is
True
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