Merge "Undercloud install: Create clouds.yaml with mode 600"

This commit is contained in:
Zuul 2022-09-13 05:33:10 +00:00 committed by Gerrit Code Review
commit 107e5f19a1

View File

@ -86,7 +86,11 @@ def create_update_clouds_yaml():
config['network_api_version'] = '2'
data['clouds'][cloud_name] = config
with open(clouds_yaml, 'w') as fs:
fdesc = os.open(path=clouds_yaml,
flags=(os.O_WRONLY | os.O_CREAT | os.O_TRUNC),
mode=0o600)
with open(fdesc, 'w') as fs:
fs.write(yaml.dump(data, default_flow_style=False))
shutil.copyfile(clouds_yaml, usr_clouds_yaml)