def get_cameras_with_filter(cameras, filter_name):
    """ Get a dict of cameras wit the required filter.
    Args:
        cameras (dict): Dict of cam_name: camera pairs.
        filter_name (str): The filter name.
    """
    cameras_with_filter = {}
    for cam_name, cam in cameras.items():

        if cam.filterwheel is None:
            if cam.filter_type == filter_name:
                cameras_with_filter[cam_name] = cam

        elif filter_name in cam.filterwheel.filter_names:
            cameras_with_filter[cam_name] = cam

    return cameras_with_filter