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))
评论列表
文章目录