mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #43524 from kbespalov/develop
[network.interface_ip] Correct handling of interfaces without IP
This commit is contained in:
commit
310f826cc0
@ -1039,7 +1039,8 @@ def interface_ip(iface):
|
||||
iface_info, error = _get_iface_info(iface)
|
||||
|
||||
if error is False:
|
||||
return iface_info.get(iface, {}).get('inet', {})[0].get('address', '')
|
||||
inet = iface_info.get(iface, {}).get('inet', None)
|
||||
return inet[0].get('address', '') if inet else ''
|
||||
else:
|
||||
return error
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user