Change-Id: I96ce83ade58de8fb1ca2ad5f3930df49cd42a96c
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
--- /dev/null
+#!/usr/bin/python -tt
+# vim: ai ts=4 sts=4 et sw=4
+
+import os
+try:
+ import json
+except ImportError:
+ import simplejson as json
+
+def get_gerrit_event():
+ """ get gerrit event info from environment parameters """
+ event = {}
+
+ for element in os.environ.keys():
+ if element.startswith('GERRIT_'):
+ event[element[len('GERRIT_'):].lower()] = os.getenv(element)
+
+ print '\nGerrit Event:\n', json.dumps(event, indent = 4)
+ return event