-
Notifications
You must be signed in to change notification settings - Fork 193
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
when run list_apps ,has errors #99
Comments
*Environment: marathon-python-0.8.1 Python 2.7.5 Linux 3.10.0-327.el7.x86_64 |
Huh. I guess we don't have an param for the Can you pb the actual json that marathon returned? And if you feel adventurous to scratch your own itch, can you add a |
Normal accessed through api: curl http://10.0.2.47:8090/v2/apps return: {"apps":[{"id":"/mysqlt1","cmd":null,"args":null,"user":null,"env":{"MYSQL_ROOT_PASSWORD":"123456"},"instances":1,"cpus":1,"mem":256,"disk":300,"executor":"","constraints":[],"uris":[],"fetch":[],"storeUrls":[],"ports":[4406],"portDefinitions":[{"port":4406,"protocol":"tcp","labels":{}}],"requirePorts":false,"backoffSeconds":1,"backoffFactor":1.15,"maxLaunchDelaySeconds":3600,"container":{"type":"DOCKER","volumes":[],"docker":{"image":"mysql:5.6","network":"BRIDGE","portMappings":[{"containerPort":3306,"hostPort":0,"servicePort":4406,"protocol":"tcp","name":"mysqlport","labels":{}}],"privileged":false,"parameters":[],"forcePullImage":false}},"healthChecks":[],"readinessChecks":[],"dependencies":[],"upgradeStrategy":{"minimumHealthCapacity":1,"maximumOverCapacity":1},"labels":{},"acceptedResourceRoles":null,"ipAddress":null,"version":"2016-05-09T08:03:27.589Z","residency":null,"versionInfo":{"lastScalingAt":"2016-05-09T08:03:27.589Z","lastConfigChangeAt":"2016-04-29T09:46:13.648Z"},"tasksStaged":1,"tasksRunning":0,"tasksHealthy":0,"tasksUnhealthy":0,"deployments":[]},{"id":"/myapp3","cmd":"sleep 100","args":null,"user":null,"env":{},"instances":2,"cpus":1,"mem":16,"disk":0,"executor":"","constraints":[],"uris":[],"fetch":[],"storeUrls":[],"ports":[10000],"portDefinitions":[{"port":10000,"protocol":"tcp","labels":{}}],"requirePorts":false,"backoffSeconds":1,"backoffFactor":1.15,"maxLaunchDelaySeconds":3600,"container":null,"healthChecks":[],"readinessChecks":[],"dependencies":[],"upgradeStrategy":{"minimumHealthCapacity":1,"maximumOverCapacity":1},"labels":{},"acceptedResourceRoles":null,"ipAddress":null,"version":"2016-05-09T09:54:52.749Z","residency":null,"versionInfo":{"lastScalingAt":"2016-05-09T09:54:52.749Z","lastConfigChangeAt":"2016-05-09T09:52:03.943Z"},"tasksStaged":0,"tasksRunning":2,"tasksHealthy":0,"tasksUnhealthy":0,"deployments":[]}]} |
May be the reason: MarathonMinimalJsonEncoder |
Thank you, the problem has been resolved |
from marathon import MarathonClient
c = MarathonClient('http://10.0.2.47:8090')
c.list_apps()
_Traceback (most recent call last):
File "", line 1, in
File "marathon/client.py", line 165, in list_apps
response, MarathonApp, is_list=True, resource_name='apps')
File "marathon/client.py", line 48, in parse_response
return [clazz.from_json(resource) for resource in target]
File "marathon/models/base.py", line 35, in from_json
return cls({to_snake_case(k): v for k, v in attributes.items()})
File "marathon/models/app.py", line 103, in init
else MarathonContainer.from_json(container)
File "marathon/models/base.py", line 35, in from_json
return cls({to_snake_case(k): v for k, v in attributes.items()})
File "marathon/models/container.py", line 26, in init
else MarathonDockerContainer().from_json(docker)
File "marathon/models/base.py", line 35, in from_json
return cls({to_snake_case(k): v for k, v in attributes.items()})
File "marathon/models/container.py", line 64, in init
for pm in (port_mappings or [])
File "marathon/models/base.py", line 35, in from_json
return cls({to_snake_case(k): v for k, v in attributes.items()})
TypeError: init() got an unexpected keyword argument 'name'
The text was updated successfully, but these errors were encountered: