docker_image_model.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:slicer_cli_web 作者: girder 项目源码 文件源码
def removeImages(self, imgList):
        """
        Attempt to remove image metadata from the mongo database
        :param imgList: a list of docker image names
        :type imgList: a list of strings

        """
        try:
            for img in imgList:
                hash = DockerImage.getHashKey(img)
                imageData = self._load(hash)
                super(DockerImageModel, self).remove(imageData.getRawData())
        except Exception as err:
            if isinstance(err, DockerImageNotFoundError):
                logger.exception('Image %r does not exist', img)
                raise DockerImageNotFoundError(
                    'The image %s with hash %s does not exist '
                    'in the database' % (img, hash), img)
            else:
                logger.exception('Could not remove image %r', img)
                raise DockerImageError(
                    'Could not delete the image data from the database '
                    'invalid image: ' + img + ' ' + str(err), img)

    # TODO validate the xml of each cli
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号