elog-gen.py : consume metadata 'process' keyword

Add a new mako template to aid elog-gen.py to generate code for handling
the metadata 'process' keyword.

Change-Id: I720ac1e30cf566f5a6bfe090faec6da9742f7423
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/tools/elog-gen.py b/tools/elog-gen.py
index 469248f..29ff52f 100755
--- a/tools/elog-gen.py
+++ b/tools/elog-gen.py
@@ -120,6 +120,7 @@
     meta = dict()  # The meta data names associated (ERRNO, FILE_NAME, ...)
     meta_data = dict()  # The meta data info (type, format)
     parents = dict()
+    metadata_process = dict()  # metadata that have the 'process' keyword set
 
     error_yamls = get_error_yaml_files(i_yaml_dir, i_test_dir)
 
@@ -150,7 +151,8 @@
                        error_lvl,
                        meta,
                        meta_data,
-                       parents))
+                       parents,
+                       metadata_process))
 
     if(not check_error_inheritance(errors, parents)):
         print("Error - failed to validate error inheritance")
@@ -164,10 +166,13 @@
     template = Template(filename=template_path)
     f = open(i_output_hpp, 'w')
     f.write(template.render(
-            errors=errors, error_msg=error_msg,
-            error_lvl=error_lvl, meta=meta,
+            errors=errors,
+            error_msg=error_msg,
+            error_lvl=error_lvl,
+            meta=meta,
             meta_data=meta_data,
-            parents=parents))
+            parents=parents,
+            metadata_process=metadata_process))
     f.close()
 
 
@@ -185,7 +190,8 @@
     i_namespace                 namespace data
     o_elog_data                 error metadata
     """
-    errors, error_msg, error_lvl, meta, meta_data, parents = o_elog_data
+    (errors, error_msg, error_lvl, meta,
+     meta_data, parents, metadata_process) = o_elog_data
     ifile = yaml.safe_load(open(i_elog_yaml))
     mfile = yaml.safe_load(open(i_elog_meta_yaml))
     for i in mfile:
@@ -222,6 +228,8 @@
                 meta_data[str_short]['str'] = j['str']
                 meta_data[str_short]['str_short'] = str_short
                 meta_data[str_short]['type'] = get_cpp_type(j['type'])
+                if(('process' in j) and (True == j['process'])):
+                    metadata_process[str_short] = fullname + "." + str_short
             meta[fullname] = tmp_meta
 
     # Debug