diff --git a/docker-net-graph.py b/docker-net-graph.py index 11ecb0c..bd0cab8 100755 --- a/docker-net-graph.py +++ b/docker-net-graph.py @@ -61,14 +61,15 @@ def generate_graph(verbose: bool, file: str): try: gateway = net['IPAM']['Config'][0]['Gateway'] - except IndexError: - gateway = None + except KeyError: + # This network doesn't seem to be used, skip it + continue internal = "" try: if net['Internal']: internal = "| Internal " - except IndexError: + except KeyError: pass isolated = ""