__init__.py 文件源码

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

项目:kcli 作者: karmab 项目源码 文件源码
def add_image(self, image, pool, cmd=None):
        shortimage = os.path.basename(image).split('?')[0]
        if pool is not None:
            pool = [p['path'] for p in self._pool_info() if p['name'] == pool]
            if pool:
                poolpath = pool[0]
            else:
                print("Pool not found. Leaving....")
                return
        downloadcmd = 'curl -Lo %s -f %s/%s' % (shortimage, poolpath, image)
        os.system(downloadcmd)
        if cmd is not None and find_executable('virt-customize') is not None:
            cmd = "virt-customize -a %s/%s %s" % (poolpath, image, cmd)
        os.system(cmd)
        return {'result': 'success'}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号