Merge "Fix passwords.yml generation when parent directory doesn't exist"

This commit is contained in:
Zuul 2023-04-14 07:27:57 +00:00 committed by Gerrit Code Review
commit 107ee93544
2 changed files with 11 additions and 0 deletions

View File

@ -20,6 +20,7 @@ short_description: Generates a kolla-ansible passwords file
from ansible.module_utils.basic import * from ansible.module_utils.basic import *
import os
import os.path import os.path
import shutil import shutil
import tempfile import tempfile
@ -238,6 +239,8 @@ def kolla_passwords(module):
checksum_temp_file = module.sha1(temp_file_path) checksum_temp_file = module.sha1(temp_file_path)
changed = checksum_dest != checksum_temp_file changed = checksum_dest != checksum_temp_file
else: else:
os.makedirs(os.path.dirname(module.params['dest']),
exist_ok=True)
changed = True changed = True
# Encrypt the file. # Encrypt the file.

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Fixes an issue where generation of ``passwords.yml`` for Kolla Ansible
could fail if the directory containing the file does not exist. This is
typical in a multiple environment setup, when creating a new environment.
See `story 2010293 <https://storyboard.openstack.org/#!/story/2010293>`_
for details.