def convert_hubs_to_datastores(hubs, datastores):
    """Get filtered subset of datastores as represented by hubs.

    :param hubs: represents a sub set of datastore ids
    :param datastores: represents all candidate datastores
    :returns: that subset of datastores objects that are also present in hubs
    """
    hubIds = [hub.hubId for hub in hubs]
    filtered_dss = [ds for ds in datastores if ds.value in hubIds]
    return filtered_dss