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
14cc5806
Kaydet (Commit)
14cc5806
authored
Mar 23, 2016
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge branch 'gferon-master'
üst
456cfdb3
7b17cfaa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
network.py
docker/api/network.py
+3
-1
network_test.py
tests/integration/network_test.py
+7
-0
No files found.
docker/api/network.py
Dosyayı görüntüle @
14cc5806
...
@@ -21,7 +21,8 @@ class NetworkApiMixin(object):
...
@@ -21,7 +21,8 @@ class NetworkApiMixin(object):
return
self
.
_result
(
res
,
json
=
True
)
return
self
.
_result
(
res
,
json
=
True
)
@minimum_version
(
'1.21'
)
@minimum_version
(
'1.21'
)
def
create_network
(
self
,
name
,
driver
=
None
,
options
=
None
,
ipam
=
None
):
def
create_network
(
self
,
name
,
driver
=
None
,
options
=
None
,
ipam
=
None
,
check_duplicate
=
None
):
if
options
is
not
None
and
not
isinstance
(
options
,
dict
):
if
options
is
not
None
and
not
isinstance
(
options
,
dict
):
raise
TypeError
(
'options must be a dictionary'
)
raise
TypeError
(
'options must be a dictionary'
)
...
@@ -30,6 +31,7 @@ class NetworkApiMixin(object):
...
@@ -30,6 +31,7 @@ class NetworkApiMixin(object):
'Driver'
:
driver
,
'Driver'
:
driver
,
'Options'
:
options
,
'Options'
:
options
,
'IPAM'
:
ipam
,
'IPAM'
:
ipam
,
'CheckDuplicate'
:
check_duplicate
}
}
url
=
self
.
_url
(
"/networks/create"
)
url
=
self
.
_url
(
"/networks/create"
)
res
=
self
.
_post_json
(
url
,
data
=
data
)
res
=
self
.
_post_json
(
url
,
data
=
data
)
...
...
tests/integration/network_test.py
Dosyayı görüntüle @
14cc5806
...
@@ -212,6 +212,13 @@ class TestNetworks(helpers.BaseTestCase):
...
@@ -212,6 +212,13 @@ class TestNetworks(helpers.BaseTestCase):
self
.
execute
(
container
,
[
'nslookup'
,
'bar'
])
self
.
execute
(
container
,
[
'nslookup'
,
'bar'
])
@requires_api_version
(
'1.21'
)
def
test_create_check_duplicate
(
self
):
net_name
,
net_id
=
self
.
create_network
()
with
self
.
assertRaises
(
docker
.
errors
.
APIError
):
self
.
client
.
create_network
(
net_name
,
check_duplicate
=
True
)
self
.
client
.
create_network
(
net_name
,
check_duplicate
=
False
)
@requires_api_version
(
'1.22'
)
@requires_api_version
(
'1.22'
)
def
test_connect_with_links
(
self
):
def
test_connect_with_links
(
self
):
net_name
,
net_id
=
self
.
create_network
()
net_name
,
net_id
=
self
.
create_network
()
...
...
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