Fix KeyError on unused networks

This commit is contained in:
LeoVerto 2018-09-10 18:45:36 +02:00
parent f1b5a1132c
commit 3586b9f0c9

View file

@ -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 = ""