Commit 1f1b4a20 authored by Daniele Venzano's avatar Daniele Venzano

Do not try to get hostname when running on a docker engine

parent ae3a4d12
......@@ -218,9 +218,12 @@ class SwarmClient:
"ip_address": {},
'host': container.attrs['Node']['Name'],
'labels': container.attrs['Config']['Labels']
} # type: Dict[str, Any]
info['host'] = container.attrs['Node']['Name'],
except KeyError:
info['host'] = 'N/A'
for net in container.attrs["NetworkSettings"]["Networks"]:
if len(container.attrs["NetworkSettings"]["Networks"][net]['IPAddress']) > 0:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment