Merge pull request #43524 from kbespalov/develop

[network.interface_ip] Correct handling of interfaces without IP
This commit is contained in:
Mike Place 2017-09-21 12:06:24 -06:00 committed by GitHub
commit 310f826cc0

View File

@ -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