diff --git a/Pipfile b/Pipfile index 290df6b..e29c3e5 100644 --- a/Pipfile +++ b/Pipfile @@ -4,10 +4,10 @@ verify_ssl = true name = "pypi" [packages] -docker = "~=3.7" +docker = "*" graphviz = "*" [dev-packages] [requires] -python_version = "3.9" +python_version = "3.10" diff --git a/docker-net-graph.py b/docker-net-graph.py index bd00804..518faa7 100755 --- a/docker-net-graph.py +++ b/docker-net-graph.py @@ -7,7 +7,7 @@ import typing from dataclasses import dataclass from graphviz import Graph -from graphviz.backend import FORMATS +from graphviz import FORMATS # colorlover.scales["12"]["qual"]["Paired"] converted to hex strings COLORS = ["#1f78b4", "#33a02c", "#e31a1c", "#ff7f00", "#6a3d9a", "#b15928", "#a6cee3", "#b2df8a", "#fdbf6f", @@ -64,7 +64,7 @@ def get_networks(client: docker.DockerClient, verbose: bool) -> typing.Dict[str, for net in sorted(client.networks.list(), key=lambda k: k.name): try: gateway = net.attrs["IPAM"]["Config"][0]["Subnet"] - except (KeyError, IndexError): + except (KeyError, IndexError, TypeError): # This network doesn't seem to be used, skip it continue