From 24d09732e584664a21755fc306665f2711c20ac9 Mon Sep 17 00:00:00 2001 From: Sabeel Ansari Date: Thu, 29 Jul 2021 11:46:39 -0400 Subject: [PATCH] Update static value during upgrade New service cert-alarm needs static value update, without which Upgrade fails. Story: 2008946 Task: 42852 Signed-off-by: Sabeel Ansari Change-Id: I6388f9a77343430fb43469096ff2310c37c9c7b7 --- .../controllerconfig/upgrades/controller.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/controllerconfig/controllerconfig/controllerconfig/upgrades/controller.py b/controllerconfig/controllerconfig/controllerconfig/upgrades/controller.py index 6033f451b6..d7613fe21e 100644 --- a/controllerconfig/controllerconfig/controllerconfig/upgrades/controller.py +++ b/controllerconfig/controllerconfig/controllerconfig/upgrades/controller.py @@ -756,6 +756,20 @@ def migrate_hiera_data(from_release, to_release, role=None): with open(static_file, 'w') as yaml_file: yaml.dump(static_config, yaml_file, default_flow_style=False) + secure_static_file = os.path.join( + constants.HIERADATA_PERMDIR, "secure_static.yaml") + with open(secure_static_file, 'r') as yaml_file: + secure_static_config = yaml.load(yaml_file) + + # This code can be removed in the release that follows StX 6.0 + sysinv_pass = utils.get_password_from_keyring('sysinv', 'services') + secure_static_config.update({ + 'sysinv::certalarm::local_keystone_password': sysinv_pass + }) + + with open(secure_static_file, 'w') as yaml_file: + yaml.dump(secure_static_config, yaml_file, default_flow_style=False) + def apply_sriov_config(db_credentials, hostname): # If controller-1 has any FEC devices or sriov vfs configured, apply the