mirror of https://github.com/docker/compose.git
Fix `ps` output to show all ports
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
f3c1c8d158
commit
d527f24ff0
|
@ -96,12 +96,16 @@ class Container(object):
|
||||||
def human_readable_ports(self):
|
def human_readable_ports(self):
|
||||||
def format_port(private, public):
|
def format_port(private, public):
|
||||||
if not public:
|
if not public:
|
||||||
return private
|
return [private]
|
||||||
return '{HostIp}:{HostPort}->{private}'.format(
|
return [
|
||||||
private=private, **public[0])
|
'{HostIp}:{HostPort}->{private}'.format(private=private, **pub)
|
||||||
|
for pub in public
|
||||||
|
]
|
||||||
|
|
||||||
return ', '.join(format_port(*item)
|
return ', '.join(
|
||||||
for item in sorted(six.iteritems(self.ports)))
|
','.join(format_port(*item))
|
||||||
|
for item in sorted(six.iteritems(self.ports))
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def labels(self):
|
def labels(self):
|
||||||
|
|
Loading…
Reference in New Issue