Fix KeyError on unused networks
This commit is contained in:
parent
f1b5a1132c
commit
3586b9f0c9
1 changed files with 4 additions and 3 deletions
|
@ -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 = ""
|
||||
|
|
Loading…
Reference in a new issue