Fixed UnboundLocalError: local variable 'network' referenced before assignment

This commit is contained in:
Alexander Hosfeld 2020-02-20 12:29:19 +01:00
parent ebcd5ac294
commit 10db26fcdd
1 changed files with 1 additions and 1 deletions

View File

@ -205,7 +205,7 @@ class ProxmoxAPI(object):
ip_address = None
networks = self.get('api2/json/nodes/{0}/qemu/{1}/agent/network-get-interfaces'.format(node, vm))['result']
if networks:
if type(network) is dict:
if type(networks) is dict:
for network in networks:
for address in network['ip-addresses']:
ip_address = address['ip-address']