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 format_port(private, public):
|
||||
if not public:
|
||||
return private
|
||||
return '{HostIp}:{HostPort}->{private}'.format(
|
||||
private=private, **public[0])
|
||||
return [private]
|
||||
return [
|
||||
'{HostIp}:{HostPort}->{private}'.format(private=private, **pub)
|
||||
for pub in public
|
||||
]
|
||||
|
||||
return ', '.join(format_port(*item)
|
||||
for item in sorted(six.iteritems(self.ports)))
|
||||
return ', '.join(
|
||||
','.join(format_port(*item))
|
||||
for item in sorted(six.iteritems(self.ports))
|
||||
)
|
||||
|
||||
@property
|
||||
def labels(self):
|
||||
|
|
Loading…
Reference in New Issue