mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't try to add a non-existent IP address
This commit is contained in:
parent
5dcaa8d387
commit
1fa69982c4
1 changed files with 5 additions and 1 deletions
|
@ -204,7 +204,11 @@ def list_nodes(call=None):
|
|||
vms[vm.find('NAME').text]['state'] = vm.find('STATE').text
|
||||
private_ips = []
|
||||
for nic in vm.find('TEMPLATE').findall('NIC'):
|
||||
private_ips.append(nic.find('IP').text)
|
||||
try:
|
||||
private_ips.append(nic.find('IP').text)
|
||||
except AttributeError:
|
||||
# There is no private IP; skip it
|
||||
pass
|
||||
vms[vm.find('NAME').text]['private_ips'] = private_ips
|
||||
vms[vm.find('NAME').text]['public_ips'] = []
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue