From d2bad43356da8369f5bfc55389b9403f80f06c39 Mon Sep 17 00:00:00 2001 From: Don Penney Date: Mon, 1 Oct 2018 14:55:07 -0400 Subject: [PATCH] Write software_version in hieradata as a string When puppet reads a unicode value from hieradata that it believes is a floating number, it automatically converts it to a float. In the case of the software_version, that means a version like '18.10' is converted to 18.1 by puppet. This results in some components and directories using the wrong value for software_version, and certain services fail. In particular, this resulted in sysinv being unable to populate the host inventory data when new nodes were installed in a running system. Queries like host-data-list or host-if-list would return empty data. This update to sysinv writes the software_version to hieradata as a string rather than unicode, ensuring puppet treats it properly. Closes-Bug: 1795400 Change-Id: Ic3ab3aea2f7fc6662f0b523070afb4b3ef7ee282 Signed-off-by: Don Penney --- sysinv/sysinv/sysinv/sysinv/puppet/platform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysinv/sysinv/sysinv/sysinv/puppet/platform.py b/sysinv/sysinv/sysinv/sysinv/puppet/platform.py index e3d53eb0c4..8d4c5fe832 100644 --- a/sysinv/sysinv/sysinv/sysinv/puppet/platform.py +++ b/sysinv/sysinv/sysinv/sysinv/puppet/platform.py @@ -75,7 +75,7 @@ class PlatformPuppet(base.BasePuppet): def _get_static_software_config(self): return { - 'platform::params::software_version': tsconfig.SW_VERSION, + 'platform::params::software_version': self.quoted_str(tsconfig.SW_VERSION), } def _get_secure_amqp_config(self): @@ -325,7 +325,7 @@ class PlatformPuppet(base.BasePuppet): # required parameters config = { 'platform::params::hostname': host.hostname, - 'platform::params::software_version': host.software_load, + 'platform::params::software_version': self.quoted_str(host.software_load), } # optional parameters