From: Ondrej Lichtner <olichtne(a)redhat.com>
Keys generated for lists of simple values would end with a '.', example:
dict1.dict2.list0. = value
This fixes the issue so the generated keys look like this:
dict_x.dict_y.list0 = value
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/Utils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py
index 38aa48b..6884dfa 100644
--- a/lnst/Common/Utils.py
+++ b/lnst/Common/Utils.py
@@ -221,10 +221,10 @@ def list_to_dot(original_list, prefix="",
key=""):
return_list = []
index = 0
for value in original_list:
- iter_key = prefix + key + str(index) + '.'
+ iter_key = prefix + key + str(index)
index += 1
if isinstance(value, collections.Mapping):
- sub_list = dict_to_dot(value, iter_key)
+ sub_list = dict_to_dot(value, iter_key + '.')
return_list.extend(sub_list)
elif isinstance(value, list):
raise Exception("Nested lists not allowed")
--
2.1.0