summaryrefslogtreecommitdiffstats
path: root/tools/elog-gen.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/elog-gen.py')
-rwxr-xr-xtools/elog-gen.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/elog-gen.py b/tools/elog-gen.py
index d10c026..88e46c8 100755
--- a/tools/elog-gen.py
+++ b/tools/elog-gen.py
@@ -66,6 +66,7 @@ def gen_elog_hpp(i_yaml_dir, i_output_hpp,
error_lvl = dict() # Error code log level (debug, info, error, ...)
meta = list() # The meta data names associated (ERRNO, FILE_NAME, ...)
meta_data = dict() # The meta data info (type, format)
+ parents = list()
error_yamls = get_error_yaml_files(i_yaml_dir)
@@ -95,7 +96,8 @@ def gen_elog_hpp(i_yaml_dir, i_output_hpp,
error_msg,
error_lvl,
meta,
- meta_data))
+ meta_data,
+ parents))
# Load the mako template and call it with the required data
yaml_dir = i_yaml_dir.strip("./")
@@ -121,7 +123,7 @@ def get_elog_data(i_elog_yaml,
i_elog_meta_yaml metadata yaml file
o_elog_data error metadata
"""
- errors, error_msg, error_lvl, meta, meta_data = o_elog_data
+ errors, error_msg, error_lvl, meta, meta_data, parents = o_elog_data
ifile = yaml.safe_load(open(i_elog_yaml))
mfile = yaml.safe_load(open(i_elog_meta_yaml))
for i in ifile:
@@ -136,6 +138,12 @@ def get_elog_data(i_elog_yaml,
exit(1)
# Grab the main error and it's info
errors.append(i['name'])
+ parent = None
+ if('inherits' in i):
+ # xyz.openbmc.Foo, we need Foo
+ # Get 0th inherited error (current support - single inheritance)
+ parent = i['inherits'][0].split(".").pop()
+ parents.append(parent)
error_msg[i['name']] = i['description']
error_lvl[i['name']] = match['level']
tmp_meta = []
OpenPOWER on IntegriCloud