Add to field_delim argument to list_to_report function
Change-Id: I082a1510abcd5e3a578a428290314b9b6c7649c6
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/var_funcs.py b/lib/var_funcs.py
index 9fee346..a3ca1ce 100644
--- a/lib/var_funcs.py
+++ b/lib/var_funcs.py
@@ -510,7 +510,8 @@
def list_to_report(report_list,
- to_lower=1):
+ to_lower=1,
+ field_delim=None):
r"""
Convert a list containing report text lines to a report "object" and
return it.
@@ -573,6 +574,9 @@
contain spaces.
to_lower Change the resulting key names to lower
case.
+ field_delim Indicates that there are field delimiters
+ in report_list entries (which should be
+ removed).
"""
if len(report_list) <= 1:
@@ -580,6 +584,9 @@
# return an empty array.
return []
+ if field_delim is not None:
+ report_list = [re.sub("\\|", "", line) for line in report_list]
+
header_line = report_list[0]
if to_lower:
header_line = header_line.lower()