Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
2240f8ef
Commit
2240f8ef
authored
Jun 10, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7714 from pmyjavec/devel
Docker links need alias specified
parents
8e3b5122
074a6f3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
library/cloud/docker
+17
-2
No files found.
library/cloud/docker
View file @
2240f8ef
...
@@ -380,7 +380,7 @@ class DockerManager:
...
@@ -380,7 +380,7 @@ class DockerManager:
self
.
links
=
None
self
.
links
=
None
if
self
.
module
.
params
.
get
(
'links'
):
if
self
.
module
.
params
.
get
(
'links'
):
self
.
links
=
dict
(
map
(
lambda
x
:
x
.
split
(
':'
),
self
.
module
.
params
.
get
(
'links'
)
))
self
.
links
=
self
.
get_links
(
self
.
module
.
params
.
get
(
'links'
))
self
.
env
=
None
self
.
env
=
None
if
self
.
module
.
params
.
get
(
'env'
):
if
self
.
module
.
params
.
get
(
'env'
):
...
@@ -391,6 +391,22 @@ class DockerManager:
...
@@ -391,6 +391,22 @@ class DockerManager:
self
.
client
=
docker
.
Client
(
base_url
=
docker_url
.
geturl
())
self
.
client
=
docker
.
Client
(
base_url
=
docker_url
.
geturl
())
def
get_links
(
self
,
links
):
"""
Parse the links passed, if a link is specified without an alias then just create the alias of the same name as the link
"""
processed_links
=
{}
for
link
in
links
:
parsed_link
=
link
.
split
(
':'
,
1
)
if
(
len
(
parsed_link
)
==
2
):
processed_links
[
parsed_link
[
0
]]
=
parsed_link
[
1
]
else
:
processed_links
[
parsed_link
[
0
]]
=
parsed_link
[
0
]
return
processed_links
def
get_exposed_ports
(
self
,
expose_list
):
def
get_exposed_ports
(
self
,
expose_list
):
"""
"""
Parse the ports and protocols (TCP/UDP) to expose in the docker-py `create_container` call from the docker CLI-style syntax.
Parse the ports and protocols (TCP/UDP) to expose in the docker-py `create_container` call from the docker CLI-style syntax.
...
@@ -452,7 +468,6 @@ class DockerManager:
...
@@ -452,7 +468,6 @@ class DockerManager:
return
binds
return
binds
def
get_split_image_tag
(
self
,
image
):
def
get_split_image_tag
(
self
,
image
):
if
'/'
in
image
:
if
'/'
in
image
:
image
=
image
.
split
(
'/'
)[
1
]
image
=
image
.
split
(
'/'
)[
1
]
...
...
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