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:
Borne Mace 2018-05-15 16:11:07 -07:00
parent 7c0bc714f1
commit 9f9b0736b1
1 changed files with 3 additions and 2 deletions

View File

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