elog-gen.py : order inherited errors

The elog-gen.py script should process errors such that the generated
code has definitions for parent errors before their child errors are
defined.

Change-Id: I035292731346bdba969f549c7e4033066814890f
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/tools/example/xyz/openbmc_project/Example/Bar.errors.yaml b/tools/example/xyz/openbmc_project/Example/Bar.errors.yaml
new file mode 100644
index 0000000..cff338b
--- /dev/null
+++ b/tools/example/xyz/openbmc_project/Example/Bar.errors.yaml
@@ -0,0 +1,4 @@
+- name: Bar
+  description: this is test error Bar
+  inherits:
+    - Foo
diff --git a/tools/example/xyz/openbmc_project/Example/Bar.metadata.yaml b/tools/example/xyz/openbmc_project/Example/Bar.metadata.yaml
new file mode 100644
index 0000000..ceebffd
--- /dev/null
+++ b/tools/example/xyz/openbmc_project/Example/Bar.metadata.yaml
@@ -0,0 +1,5 @@
+- name: Bar
+  level: INFO
+  meta:
+    - str: "BAR_DATA=%s"
+      type: string
diff --git a/tools/example/xyz/openbmc_project/Example/Elog.errors.yaml b/tools/example/xyz/openbmc_project/Example/Elog.errors.yaml
index 1ec9997..6f75178 100644
--- a/tools/example/xyz/openbmc_project/Example/Elog.errors.yaml
+++ b/tools/example/xyz/openbmc_project/Example/Elog.errors.yaml
@@ -1,5 +1,7 @@
 - name: TestErrorOne
   description: this is test error one
+  inherits:
+    - TestErrorTwo
 
 - name: TestErrorTwo
   description: This is test error two
diff --git a/tools/example/xyz/openbmc_project/Example/Foo.errors.yaml b/tools/example/xyz/openbmc_project/Example/Foo.errors.yaml
index 5ab311f..e81571c 100644
--- a/tools/example/xyz/openbmc_project/Example/Foo.errors.yaml
+++ b/tools/example/xyz/openbmc_project/Example/Foo.errors.yaml
@@ -1,4 +1,4 @@
 - name: Foo
   description: this is test error Foo
   inherits:
-      - example.xyz.openbmc_project.Example.TestErrorOne
+    - example.xyz.openbmc_project.Example.TestErrorOne