Fix integer property persistence issue
When integer properties were persisted there was an ellipsis added on the following line. This also happens with boolean properties when using the yaml.safe_dump() method. Boolean values were fixed properly but integer values were missed. Integer values are now persisted properly. Change-Id: Ibe366363e0a9dab5fadbbe63d5f5407e31b2938e
This commit is contained in:
parent
7c0bc714f1
commit
9f9b0736b1
|
@ -299,9 +299,10 @@ def _get_property_line(key, value):
|
|||
line = '%s: "%s"' % (key, value)
|
||||
else:
|
||||
str_value = yaml.safe_dump(value).strip()
|
||||
if type(value) is bool:
|
||||
value_type = type(value)
|
||||
if value_type is bool or value_type is int:
|
||||
# yaml dump adds a newline and an ellipsis after
|
||||
# a boolean value. This needs to be stripped.
|
||||
# a boolean or int value. This needs to be stripped.
|
||||
str_value = str_value.replace('\n...', '')
|
||||
line = '%s: %s' % (key, str_value)
|
||||
return line
|
||||
|
|
Loading…
Reference in New Issue