Fix IndexError on unconfigured networks

This commit is contained in:
LeoVerto 2018-09-14 18:07:24 +02:00
parent 3586b9f0c9
commit 4390b6da78

View file

@ -61,7 +61,7 @@ def generate_graph(verbose: bool, file: str):
try: try:
gateway = net['IPAM']['Config'][0]['Gateway'] gateway = net['IPAM']['Config'][0]['Gateway']
except KeyError: except (KeyError, IndexError):
# This network doesn't seem to be used, skip it # This network doesn't seem to be used, skip it
continue continue