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
3cd66b66
Kaydet (Commit)
3cd66b66
authored
Agu 18, 2015
tarafından
Aanand Prasad
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #719 from docker/allow-path-in-host
Allow docker host (base_url) to contain a path
üst
139850f3
adb2d018
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
utils.py
docker/utils/utils.py
+7
-2
utils_test.py
tests/utils_test.py
+4
-1
No files found.
docker/utils/utils.py
Dosyayı görüntüle @
3cd66b66
...
@@ -232,6 +232,7 @@ def parse_host(addr):
...
@@ -232,6 +232,7 @@ def parse_host(addr):
proto
=
"http+unix"
proto
=
"http+unix"
host
=
DEFAULT_HTTP_HOST
host
=
DEFAULT_HTTP_HOST
port
=
None
port
=
None
path
=
''
if
not
addr
or
addr
.
strip
()
==
'unix://'
:
if
not
addr
or
addr
.
strip
()
==
'unix://'
:
return
DEFAULT_UNIX_SOCKET
return
DEFAULT_UNIX_SOCKET
...
@@ -270,8 +271,12 @@ def parse_host(addr):
...
@@ -270,8 +271,12 @@ def parse_host(addr):
if
host_parts
[
0
]:
if
host_parts
[
0
]:
host
=
host_parts
[
0
]
host
=
host_parts
[
0
]
port
=
host_parts
[
1
]
if
'/'
in
port
:
port
,
path
=
port
.
split
(
'/'
,
1
)
path
=
'/{0}'
.
format
(
path
)
try
:
try
:
port
=
int
(
host_parts
[
1
]
)
port
=
int
(
port
)
except
Exception
:
except
Exception
:
raise
errors
.
DockerException
(
raise
errors
.
DockerException
(
"Invalid port:
%
s"
,
addr
"Invalid port:
%
s"
,
addr
...
@@ -285,7 +290,7 @@ def parse_host(addr):
...
@@ -285,7 +290,7 @@ def parse_host(addr):
if
proto
==
"http+unix"
:
if
proto
==
"http+unix"
:
return
"{0}://{1}"
.
format
(
proto
,
host
)
return
"{0}://{1}"
.
format
(
proto
,
host
)
return
"{0}://{1}:{2}
"
.
format
(
proto
,
host
,
port
)
return
"{0}://{1}:{2}
{3}"
.
format
(
proto
,
host
,
port
,
path
)
def
parse_devices
(
devices
):
def
parse_devices
(
devices
):
...
...
tests/utils_test.py
Dosyayı görüntüle @
3cd66b66
...
@@ -72,7 +72,10 @@ class UtilsTest(base.BaseTestCase):
...
@@ -72,7 +72,10 @@ class UtilsTest(base.BaseTestCase):
''
:
'http+unix://var/run/docker.sock'
,
''
:
'http+unix://var/run/docker.sock'
,
None
:
'http+unix://var/run/docker.sock'
,
None
:
'http+unix://var/run/docker.sock'
,
'unix:///var/run/docker.sock'
:
'http+unix:///var/run/docker.sock'
,
'unix:///var/run/docker.sock'
:
'http+unix:///var/run/docker.sock'
,
'unix://'
:
'http+unix://var/run/docker.sock'
'unix://'
:
'http+unix://var/run/docker.sock'
,
'somehost.net:80/service/swarm'
:
(
'http://somehost.net:80/service/swarm'
),
}
}
for
host
in
invalid_hosts
:
for
host
in
invalid_hosts
:
...
...
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