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 <don.penney@windriver.com>
This commit is contained in:
Don Penney 2018-10-01 14:55:07 -04:00
parent 9a28c4d853
commit 41b0a21603
1 changed files with 2 additions and 2 deletions

View File

@ -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