From 2a89518aef67f7832a5d6f83a95437fb89cca328 Mon Sep 17 00:00:00 2001 From: LeoVerto Date: Fri, 31 Aug 2018 21:34:24 +0200 Subject: [PATCH] Read network ICC value --- docker-net-graph.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docker-net-graph.py b/docker-net-graph.py index 3125f1b..11ecb0c 100755 --- a/docker-net-graph.py +++ b/docker-net-graph.py @@ -64,21 +64,26 @@ def generate_graph(verbose: bool, file: str): except IndexError: gateway = None + internal = "" try: if net['Internal']: - internal = "| Internal" - else: - internal = "" - + internal = "| Internal " except IndexError: - internal = "" + pass + + isolated = "" + try: + if net["Options"]["com.docker.network.bridge.enable_icc"] == "false": + isolated = "| Containers isolated" + except KeyError: + pass if verbose: print("Network: %s %s gw:%s" % (net_name, internal, gateway)) net_node_id = "net_%s" % (net_name,) - label = "{ %s | %s %s}" % (gateway, net_name, internal) + label = "{ %s | %s %s%s}" % (gateway, net_name, internal, isolated) g.node(net_node_id, shape='record',