From 9f9b0736b19625963fca18797a7296bc29ca67fa Mon Sep 17 00:00:00 2001 From: Borne Mace Date: Tue, 15 May 2018 16:11:07 -0700 Subject: [PATCH] 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 --- kolla_cli/common/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kolla_cli/common/utils.py b/kolla_cli/common/utils.py index 4fb4c80..e10c806 100644 --- a/kolla_cli/common/utils.py +++ b/kolla_cli/common/utils.py @@ -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