summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-01-17 08:50:55 -0600
committerDeepak Kodihalli <dkodihal@in.ibm.com>2017-01-27 10:42:25 -0600
commitcbd12c8f5d0d5227f8eebf10302188a9bfc54f20 (patch)
treeda8a26ef69354d6554068b6acd4cbe5a1cd92333 /tools
parent82b7de7e3211659a3dd323d7a986cfec7a3751ff (diff)
downloadphosphor-logging-cbd12c8f5d0d5227f8eebf10302188a9bfc54f20.tar.gz
phosphor-logging-cbd12c8f5d0d5227f8eebf10302188a9bfc54f20.zip
elog-gen.py : check error inheritance
Check if errors that are being inherited from have their interfaces defined. Throw an error if not. Change-Id: I13c6b844ef46eef7fead7a5f8ae1d8b56d914ecf Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/elog-gen.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/elog-gen.py b/tools/elog-gen.py
index 88e46c8..d1acb79 100755
--- a/tools/elog-gen.py
+++ b/tools/elog-gen.py
@@ -18,6 +18,14 @@ import sys
import os
+def check_error_inheritance(i_errors, i_parents):
+ for parent in i_parents:
+ if(parent and (parent not in i_errors)):
+ print parent + " inhertied from, but not defined"
+ return False
+ return True
+
+
def get_error_yaml_files(i_yaml_dir):
yaml_files = filter(
lambda file: file.endswith('.errors.yaml'),
@@ -99,6 +107,10 @@ def gen_elog_hpp(i_yaml_dir, i_output_hpp,
meta_data,
parents))
+ if(not check_error_inheritance(errors, parents)):
+ print "Error - failed to validate error inheritance"
+ exit(1)
+
# Load the mako template and call it with the required data
yaml_dir = i_yaml_dir.strip("./")
yaml_dir = yaml_dir.strip("../")
OpenPOWER on IntegriCloud