Add float types to load_items to support configuration parameters of float type

Complement missing float types when loading configuration group parameters
so that parameters of type float can be attached into the trove instance successfully

Story: 2008917
Task: 42508
Change-Id: Iae4d8fc52a50da4fd347270271f6761ce766d5c3
(cherry picked from commit 189d3493a8)
This commit is contained in:
chimeng 2021-05-25 13:14:47 +08:00
parent c551eac983
commit 1c38b4c9bc
1 changed files with 2 additions and 0 deletions

View File

@ -166,6 +166,8 @@ class Configuration(object):
item.configuration_value = bool(int(item.configuration_value))
elif rule.data_type == 'integer':
item.configuration_value = int(item.configuration_value)
elif rule.data_type == 'float':
item.configuration_value = float(item.configuration_value)
else:
item.configuration_value = str(item.configuration_value)
return config_items