Fixed python3 errors
Modified `network` > `networks`. Also fixed Python3 `TypeError: string indices must be integers` dict error.
This commit is contained in:
parent
ebcd5ac294
commit
3650024b1d
|
@ -205,10 +205,9 @@ 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']
|
||||
for ip_address in ['ip-address']:
|
||||
try:
|
||||
# IP address validation
|
||||
if socket.inet_aton(ip_address):
|
||||
|
|
Reference in New Issue