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:
|
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 = ""
|
||||||
|
|
Loading…
Reference in a new issue