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: try:
gateway = net['IPAM']['Config'][0]['Gateway'] gateway = net['IPAM']['Config'][0]['Gateway']
except IndexError: except KeyError:
gateway = None # This network doesn't seem to be used, skip it
continue
internal = "" internal = ""
try: try:
if net['Internal']: if net['Internal']:
internal = "| Internal " internal = "| Internal "
except IndexError: except KeyError:
pass pass
isolated = "" isolated = ""