From 2f4b45cd17ca348f699cdcf6a3e63e3d3cc35184 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Fri, 3 Nov 2023 17:42:35 +0000 Subject: [PATCH] Stop merging config when symlink points to same file This can result in duplicated configuration options. Change-Id: I4dd6ffae027345b8c1cc217a63e85f8af7fc9746 Closes-Bug: #2042689 --- .../action_plugins/kolla_custom_config_info.py | 3 +++ ...erging-symlinks-to-identical-files-dfa3593fcf405510.yaml | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100644 releasenotes/notes/stop-merging-symlinks-to-identical-files-dfa3593fcf405510.yaml diff --git a/ansible/roles/kolla-openstack/action_plugins/kolla_custom_config_info.py b/ansible/roles/kolla-openstack/action_plugins/kolla_custom_config_info.py index f5ad15429..c303eda95 100644 --- a/ansible/roles/kolla-openstack/action_plugins/kolla_custom_config_info.py +++ b/ansible/roles/kolla-openstack/action_plugins/kolla_custom_config_info.py @@ -119,6 +119,9 @@ class ConfigCollector(object): if not rule: continue + sources = map(os.path.realpath, sources) + sources = _dedup(sources) + if rule["strategy"] == 'copy': copy = { "src": sources[-1], diff --git a/releasenotes/notes/stop-merging-symlinks-to-identical-files-dfa3593fcf405510.yaml b/releasenotes/notes/stop-merging-symlinks-to-identical-files-dfa3593fcf405510.yaml new file mode 100644 index 000000000..cc4198f52 --- /dev/null +++ b/releasenotes/notes/stop-merging-symlinks-to-identical-files-dfa3593fcf405510.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Stop merging config when a symlink points to the same file. This + was a common pattern before the merging of kolla config was introduced + and results in duplicated config options.