push.py 文件源码

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

项目:DeepSea 作者: SUSE 项目源码 文件源码
def convert(self, common):
        """
        Process all hardware profiles
        """
        for pathname in common.keys():
            for filename in common[pathname]:
                if 'profile-' in filename:
                    with open(filename, "r") as yml:
                        content = yaml.safe_load(yml)
                    migrated = _migrate(content, filename)
                    newfilename = re.sub('profile-', 'migrated-profile-', filename)
                    path_dir = os.path.dirname(newfilename)
                    _create_dirs(path_dir, self.pillar_dir)
                    with open(newfilename, "w") as yml:
                        yml.write(yaml.dump(migrated,
                                  Dumper=self.friendly_dumper,
                                  default_flow_style=False))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号