def get_ports_from_device_id(neutron_client, device_id):
    """Return the ports associated with a given device.

    :param neutron_client: Authenticated neutronclient
    :type neutron_client: neutronclient.Client object
    :param device_id: The id of the device to look for
    :type device_id: str
    :returns: List of port objects
    :rtype: []
    """
    ports = []
    for _port in neutron_client.list_ports().get('ports'):
        if device_id in _port.get('device_id'):
            ports.append(_port)
    return ports