From 4390b6da780928b8a36ab3b02ebf40cf5aed9874 Mon Sep 17 00:00:00 2001 From: LeoVerto Date: Fri, 14 Sep 2018 18:07:24 +0200 Subject: [PATCH] Fix IndexError on unconfigured networks --- docker-net-graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-net-graph.py b/docker-net-graph.py index bd0cab8..3852f9b 100755 --- a/docker-net-graph.py +++ b/docker-net-graph.py @@ -61,7 +61,7 @@ def generate_graph(verbose: bool, file: str): try: gateway = net['IPAM']['Config'][0]['Gateway'] - except KeyError: + except (KeyError, IndexError): # This network doesn't seem to be used, skip it continue