Skip to content

add service_port argument#11

Merged
mbabineau merged 1 commit intothefactory:masterfrom
danielfrg:master
Oct 9, 2014
Merged

add service_port argument#11
mbabineau merged 1 commit intothefactory:masterfrom
danielfrg:master

Conversation

@danielfrg
Copy link
Copy Markdown
Contributor

There was a bug when you tried to use the lib to start a docker container in marathon. The problem was that marathon is returning a json field servicePort and the code is trying to map it to service_port which didn't exists on the __init__.

The problem only affected the response parsing, the task in marathon was created fine.

Now I was able to do it like this:

from marathon import MarathonClient
from marathon.models.container import MarathonContainer, MarathonDockerContainer, MarathonContainerPortMapping

c = MarathonClient('http://localhost:8080/')
ports = MarathonContainerPortMapping(container_port=4444)
docker = MarathonDockerContainer('danielfrg/selenium', network='BRIDGE', port_mappings=[ports])
container = MarathonContainer(docker=docker)
app = MarathonApp(container=container, mem=300, cpus=0.5)
c.create_app('selenium', app)

Thanks for the lib :)

@mbabineau
Copy link
Copy Markdown
Member

(new in 0.7.3)
👍 thanks!

mbabineau added a commit that referenced this pull request Oct 9, 2014
add service_port argument (Marathon 0.7.3)
@mbabineau mbabineau merged commit 2fc8964 into thefactory:master Oct 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants