Fix lines that depend on the 'networks' key being in values list

This commit is contained in:
Red5d
2021-07-28 23:19:19 -04:00
committed by GitHub
parent d8e5aacf20
commit a1f2aabdee

View File

@@ -80,11 +80,11 @@ def generate(cname):
'tty': cattrs['Config']['Tty']
}
networks = {}
if values['networks'] == set():
del values['networks']
else:
networklist = c.networks.list()
networks = {}
for network in networklist:
if network.attrs['Name'] in values['networks']:
networks[network.attrs['Name']] = {'external': (not network.attrs['Internal'])}