Update elog-gen.py for python3
2to3 suggested this change as a better, though not strictly necessary,
way to do things.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I2147d5a6e334f25d5a57250584eb0c77e88526a3
diff --git a/tools/elog-gen.py b/tools/elog-gen.py
index 92abe35..af2e1ff 100755
--- a/tools/elog-gen.py
+++ b/tools/elog-gen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
r"""
This script will parse error log yaml file(s) and generate
@@ -64,14 +64,14 @@
yaml_files = dict()
if i_yaml_dir != "None":
for root, dirs, files in os.walk(i_yaml_dir):
- for files in filter(lambda file:
- file.endswith('.errors.yaml'), files):
+ for files in \
+ [file for file in files if file.endswith('.errors.yaml')]:
splitdir = root.split(i_yaml_dir)[1] + "/" + files[:-12]
if splitdir.startswith("/"):
splitdir = splitdir[1:]
yaml_files[(os.path.join(root, files))] = splitdir
for root, dirs, files in os.walk(i_test_dir):
- for files in filter(lambda file: file.endswith('.errors.yaml'), files):
+ for files in [file for file in files if file.endswith('.errors.yaml')]:
splitdir = root.split(i_test_dir)[1] + "/" + files[:-12]
yaml_files[(os.path.join(root, files))] = splitdir
return yaml_files