Train-only: Do not attempt to remove config-download files

The change c488b59b95 made sure
the config-download files are always recreated with the proper
permissions but that causes permission errors if ceph or octavia is
deployed because these services generate files owned by tripleo-admin
in the config-download data directory.

This change removes the clean up steps to avoid that permission errors.
This means users need to manually remove these files in case they want
to correct permissions of the config-download files.

Related-Bug: #1990226
Resolves: rhbz#2137484
Change-Id: Ib819c40862302065b6b52f68f0460f3d533d2194
This commit is contained in:
Takashi Kajinami 2022-10-25 16:42:28 +09:00
parent c488b59b95
commit ef8fb6935f
2 changed files with 1 additions and 5 deletions

View File

@ -129,10 +129,6 @@ class DownloadConfigAction(base.TripleOAction):
# Set umask to avoid a=rwx
os.umask(0o007)
# remove existing files so that we recreate all files with proper umask
if os.path.exists(self.work_dir):
shutil.rmtree(self.work_dir)
swift = self.get_object_client(context)
swiftutils.download_container(swift, self.container_config,
self.work_dir)

View File

@ -187,7 +187,7 @@ class DownloadConfigActionTest(base.TestCase):
mock_os_path_exists,
mock_os_unlink):
mock_mkdtemp.return_value = '/var/lib/mistral/uuid'
mock_os_path_exists.side_effect = [False, True]
mock_os_path_exists.return_value = True
action = config.DownloadConfigAction(self.config_container)
action.run(self.ctx)
mock_swiftutils.assert_called_once_with(self.swift,