diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2017-02-19 09:53:34 -0600 |
---|---|---|
committer | Adriana Kobylak <anoo@us.ibm.com> | 2017-02-28 10:47:36 -0600 |
commit | f4690738e8bab23fef814ad0b19132128983a363 (patch) | |
tree | 8bd8cd1d3e9eca20850cb6ddf1fe14fa5bbfe1a9 /tools | |
parent | 1a7508bbfd10ab9b97cfff757e57a88b7a34c576 (diff) | |
download | phosphor-logging-f4690738e8bab23fef814ad0b19132128983a363.tar.gz phosphor-logging-f4690738e8bab23fef814ad0b19132128983a363.zip |
elog-gen.py: Support subdirs
Add ability for elog-gen.py to find yaml files under subdirectories
so that yaml files found in Error/Callout/ and Error/IIC/ for
example can be found by the caller just passing the Error/ directory.
Change-Id: I91dcd523d2a75deea6266a3ea6885b88cd788206
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/elog-gen.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/elog-gen.py b/tools/elog-gen.py index 168e1fd..fe4807e 100755 --- a/tools/elog-gen.py +++ b/tools/elog-gen.py @@ -57,9 +57,10 @@ def check_error_inheritance(i_errors, i_parents): def get_error_yaml_files(i_yaml_dir): - yaml_files = filter( - lambda file: file.endswith('.errors.yaml'), - os.listdir(i_yaml_dir)) + yaml_files = [] + for root, dirs, files in os.walk(i_yaml_dir): + for files in filter(lambda file: file.endswith('.errors.yaml'), files): + yaml_files.append(os.path.join(root, files)) return yaml_files @@ -110,7 +111,6 @@ def gen_elog_hpp(i_yaml_dir, i_output_hpp, for error_yaml in error_yamls: # Verify the error yaml file - error_yaml = "/".join((i_yaml_dir, error_yaml)) if (not (os.path.isfile(error_yaml))): print("Can not find input yaml file " + error_yaml) exit(1) |