undercloud.py 文件源码

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

项目:apex 作者: opnfv 项目源码 文件源码
def setup_volumes(self):
        for img_file in ('overcloud-full.vmlinuz', 'overcloud-full.initrd',
                         self.image_name):
            src_img = os.path.join(self.image_path, img_file)
            if img_file == self.image_name:
                dest_img = os.path.join(constants.LIBVIRT_VOLUME_PATH,
                                        'undercloud.qcow2')
            else:
                dest_img = os.path.join(constants.LIBVIRT_VOLUME_PATH,
                                        img_file)
            if not os.path.isfile(src_img):
                raise ApexUndercloudException(
                    "Required source file does not exist:{}".format(src_img))
            if os.path.exists(dest_img):
                os.remove(dest_img)
            shutil.copyfile(src_img, dest_img)
            shutil.chown(dest_img, user='qemu', group='qemu')
            os.chmod(dest_img, 0o0744)
        # TODO(trozet):check if resize needed right now size is 50gb
        # there is a lib called vminspect which has some dependencies and is
        # not yet available in pip.  Consider switching to this lib later.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号