#!/usr/bin/env python3 import os from shutil import copyfile import yaml os.umask(0o077) copyfile('/autoinstall.yaml', '/autoinstall.yaml_before-early-command') config = {} with open('/autoinstall.yaml', 'r') as file: config = yaml.safe_load(file) try: for c in config['storage']['config']: if 'type' not in c or c['type'] != 'disk' or 'path' not in c: continue c['path'] = os.path.realpath(c['path']) with open('/autoinstall.yaml', 'w') as file: yaml.dump(config, file, default_flow_style=False) except KeyError: pass