def queue_image(self, image_id):
        if self.is_cached(image_id):
            msg = _("Not queueing image '%s'. Already cached.") % image_id
            logger.warn(msg)
            return False

        if self.is_being_cached(image_id):
            msg = _("Not queueing image '%s'. Already being "
                    "written to cache") % image_id
            logger.warn(msg)
            return False

        if self.is_queued(image_id):
            msg = _("Not queueing image '%s'. Already queued.") % image_id
            logger.warn(msg)
            return False

        path = self.get_image_filepath(image_id, 'queue')
        logger.debug(_("Queueing image '%s'."), image_id)

        # Touch the file to add it to the queue
        with open(path, "w") as f:
            pass

        return True
This adds a image to be cache to the queue.
dataset/ETHPy150Open rcbops/glance-buildpackage/glance/image_cache/drivers/xattr.py/Driver.queue_image