From: Ondrej Lichtner <olichtne(a)redhat.com>
Options are stored as tuples which caused problems when serializing them
for PerfRepo. This needs to be properly fixed by replacing tuples with
dictionaries but that might cause different problems elsewhere so for
now I'm submitting this temporary fix.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/Utils.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py
index 39c851f..fd86a8e 100644
--- a/lnst/Common/Utils.py
+++ b/lnst/Common/Utils.py
@@ -229,6 +229,10 @@ def list_to_dot(original_list, prefix="",
key=""):
return_list.extend(sub_list)
elif isinstance(value, list):
raise Exception("Nested lists not allowed")
+ elif isinstance(value, tuple):
+ #TODO temporary fix, tuples shouldn't be here
+ if len(value) == 2:
+ return_list.append((iter_key+'.'+value[0], value[1]))
else:
return_list.append((iter_key, value))
return return_list
@@ -242,6 +246,10 @@ def dict_to_dot(original_dict, prefix=""):
elif isinstance(value, list):
sub_list = list_to_dot(value, prefix, key)
return_list.extend(sub_list)
+ elif isinstance(value, tuple):
+ #TODO temporary fix, tuples shouldn't be here
+ if len(value) == 2:
+ return_list.append((iter_key+'.'+value[0], value[1]))
else:
return_list.append((prefix+key, str(value)))
return return_list
--
2.1.0