mirror of https://github.com/nicolargo/glances.git
Correct an issue when containers ports as no destination
This commit is contained in:
parent
10111cc7f6
commit
bdd66c56d3
|
|
@ -361,6 +361,11 @@ class DockerExtension:
|
|||
|
||||
# Manage ports (see issue#2054)
|
||||
if hasattr(container, 'ports'):
|
||||
stats['ports'] = ','.join([f'{container.ports[cp][0]["HostPort"]}->{cp}' for cp in container.ports])
|
||||
stats['ports'] = ','.join(
|
||||
[
|
||||
f'{container.ports[cp][0]["HostPort"]}->{cp}' if container.ports[cp] else f'{cp}'
|
||||
for cp in container.ports
|
||||
]
|
||||
)
|
||||
|
||||
return stats
|
||||
|
|
|
|||
|
|
@ -406,6 +406,11 @@ class PodmanExtension:
|
|||
|
||||
# Manage ports (see issue#2054)
|
||||
if hasattr(container, 'ports'):
|
||||
stats['ports'] = ','.join([f'{container.ports[cp][0]["HostPort"]}->{cp}' for cp in container.ports])
|
||||
stats['ports'] = ','.join(
|
||||
[
|
||||
f'{container.ports[cp][0]["HostPort"]}->{cp}' if container.ports[cp] else f'{cp}'
|
||||
for cp in container.ports
|
||||
]
|
||||
)
|
||||
|
||||
return stats
|
||||
|
|
|
|||
Loading…
Reference in New Issue