From a1e5c284d19d74256d83b1825d8353fe6d60a055 Mon Sep 17 00:00:00 2001 From: to-bar <46519524+to-bar@users.noreply.github.com> Date: Sat, 18 Jul 2020 11:27:15 +0200 Subject: [PATCH] Ensure settings for backward compatibility --- .../cli/engine/ansible/AnsibleInventoryUpgrade.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/src/epicli/cli/engine/ansible/AnsibleInventoryUpgrade.py b/core/src/epicli/cli/engine/ansible/AnsibleInventoryUpgrade.py index 17c86dc2f1..2f76d17259 100644 --- a/core/src/epicli/cli/engine/ansible/AnsibleInventoryUpgrade.py +++ b/core/src/epicli/cli/engine/ansible/AnsibleInventoryUpgrade.py @@ -82,6 +82,16 @@ def upgrade(self): manifest_docs = load_yamls_file(path_to_manifest) self.shared_config = select_single(manifest_docs, lambda x: x.kind == 'configuration/shared-config') + # Ensure settings for backward compatibility + compatibility_settings = { + 'vault_location': '', # for Epiphany v0.4 + 'use_ha_control_plane': False, # for Epiphany v0.5 + 'promote_to_ha': False # for Epiphany v0.5 + } + for key, value in compatibility_settings.items(): + if key not in self.shared_config.specification: + self.shared_config.specification[key] = value + if build_version == BUILD_LEGACY: self.logger.info(f'Upgrading Ansible inventory Epiphany < 0.3.0')