You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think you have a bug in MarathonContainerPortMapping class. Object generated from this class isn't iterable so bug is shown when you try to build docker container from this client. First MarathonContainerPortMapping doesn't returning iterator ,and second maybe it's better to this object (from class MarathonContainerPortMapping) contains list of PortMapping objects that contains container_port=, host_port=, service_port=, protocol'. And of course returning these elements through iterator.
from marathon import MarathonClient
from marathon.models.container import MarathonContainer
from marathon.models.container import MarathonDockerContainer
from marathon.models.container import MarathonContainerPortMapping
from marathon.models.container import MarathonContainerVolume
c = MarathonClient("localhost:8080")
portMapping = MarathonContainerPortMapping(container_port=80, host_port=0, service_port=1822, protocol='tcp')
docker = MarathonDockerContainer(image="ppoint/cmsv2", network="BRIDGE", port_mappings=portMapping)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/marathon/models/container.py", line 56, in init
for pm in (port_mappings or [])
TypeError: 'MarathonContainerPortMapping' object is not iterable
python --version
Python 2.7.5
The text was updated successfully, but these errors were encountered:
Hi,
I think you have a bug in MarathonContainerPortMapping class. Object generated from this class isn't iterable so bug is shown when you try to build docker container from this client. First MarathonContainerPortMapping doesn't returning iterator ,and second maybe it's better to this object (from class MarathonContainerPortMapping) contains list of PortMapping objects that contains container_port=, host_port=, service_port=, protocol'. And of course returning these elements through iterator.
from marathon import MarathonClient
from marathon.models.container import MarathonContainer
from marathon.models.container import MarathonDockerContainer
from marathon.models.container import MarathonContainerPortMapping
from marathon.models.container import MarathonContainerVolume
c = MarathonClient("localhost:8080")
portMapping = MarathonContainerPortMapping(container_port=80, host_port=0, service_port=1822, protocol='tcp')
docker = MarathonDockerContainer(image="ppoint/cmsv2", network="BRIDGE", port_mappings=portMapping)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/marathon/models/container.py", line 56, in init
for pm in (port_mappings or [])
TypeError: 'MarathonContainerPortMapping' object is not iterable
python --version
Python 2.7.5
The text was updated successfully, but these errors were encountered: