blob: 93d72b2d50fc923baa5fbfe97417e95852d7ca48 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/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
|