Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add service_port argument #11

Merged
merged 1 commit into from
Oct 9, 2014
Merged

add service_port argument #11

merged 1 commit into from
Oct 9, 2014

Conversation

danielfrg
Copy link
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
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