Skip to content

Commit

Permalink
Fix ps output to show all ports
Browse files Browse the repository at this point in the history
Signed-off-by: Joffrey F <joffrey@docker.com>
  • Loading branch information
shin- committed Jun 16, 2017
1 parent 696ddf6 commit 4f532f6
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions compose/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,16 @@ def ports(self):
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 ', '.join(format_port(*item)
for item in sorted(six.iteritems(self.ports)))
return [private]
return [
'{HostIp}:{HostPort}->{private}'.format(private=private, **pub)
for pub in public
]

return ', '.join(
','.join(format_port(*item))
for item in sorted(six.iteritems(self.ports))
)

@property
def labels(self):
Expand Down

0 comments on commit 4f532f6

Please sign in to comment.