def get_network_interface_ip(interface):
    addresses = ((interface.ipv4_addresses + interface.ipv6_addresses) if ipv4_first else (interface.ipv6_addresses + interface.ipv4_addresses))
    return (addresses[0].split('/')[0] if (len(addresses) > 0) else None)
def get_network_interface_ip(interface):
    addresses = ((interface.ipv4_addresses + interface.ipv6_addresses) if ipv4_first else (interface.ipv6_addresses + interface.ipv4_addresses))
    return (addresses[0].split('/')[0] if (len(addresses) > 0) else None)