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', '')
 else:
  return error

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' , '' ) else : return error
return the inet address for a given interface .