Upgrade: fix hieradata software version mismatch

This commit disables updating puppet hiera data in runtime if the
software load of a host is different from the active controller, to
prevent the hiera data software version mismatch during an
upgrade/rollback procedure.

Tested with an upgrade and rollback an AIODX system.

Closes-Bug: 1911457
Change-Id: I42a953c0a31b80f2536de9292ed8b17789f6328c
Signed-off-by: Yuxing Jiang <yuxing.jiang@windriver.com>
This commit is contained in:
Yuxing Jiang 2021-01-14 09:37:11 -05:00
parent eb06214cff
commit 6a51c9420a
1 changed files with 8 additions and 2 deletions

View File

@ -8761,8 +8761,14 @@ class ConductorManager(service.PeriodicService):
host.invprovision == constants.PROVISIONED or
(host.invprovision == constants.PROVISIONING and
host.personality == constants.CONTROLLER)):
self._puppet.update_host_config(host, config_uuid)
host_updated = True
if host.software_load == tsc.SW_VERSION:
# We will not generate the hieradata in runtime here if the
# software load of the host is different from the active
# controller. The Hieradata of a host during an upgrade/rollback
# will be saved by update_host_config_upgrade() to the
# directory of the host's software load.
self._puppet.update_host_config(host, config_uuid)
host_updated = True
else:
LOG.info(
"Cannot regenerate the configuration for %s, "