Pylint for job_jobs_dispatcher.py
authorLingchaox Xin <lingchaox.xin@intel.com>
Tue, 2 Jul 2013 07:12:07 +0000 (15:12 +0800)
committerLingchaox Xin <lingchaox.xin@intel.com>
Tue, 2 Jul 2013 07:12:07 +0000 (15:12 +0800)
Change-Id: Iaa8150a9f03db2030549791823ccebef03979df8

job_jobs_dispatcher.py

index e437da7..31f725e 100755 (executable)
@@ -1,10 +1,9 @@
 #!/usr/bin/env python
-#
-# This job require the Parameterized Build plugin, it's triggered
-# by http request get method to the job url, for example
-# http://my.host.com/job/JOB_NAME/buildWithParameters with data
-#
-#
+
+"""This job require the Parameterized Build plugin, it's triggered
+by http request get method to the job url, for example
+http://my.host.com/job/JOB_NAME/buildWithParameters with data
+"""
 
 import sys
 import os
@@ -12,19 +11,20 @@ import os
 from common.buildtrigger import trigger_next, trigger_info
 
 def main(obs_event_fields):
+    """The main body"""
     trigger_next(obs_event_fields['event_type'],
                  obs_event_fields)
 
 if __name__ == '__main__':
-    """ Jenkins task dispatcher, receive events from OBS jenkins notify plugin
-         and create files to trigger downstream jobs """
+    # Jenkins task dispatcher, receive events from OBS jenkins notify plugin
+    # and create files to trigger downstream jobs
     if len(sys.argv) == 1:
-        project = os.getenv('project')
-        obs_event_fields = trigger_info(os.getenv('para'))
-        obs_event_type = os.getenv('event_type')
+        PROJECT = os.getenv('project')
+        OBS_EVENT_FIELDS = trigger_info(os.getenv('para'))
+        OBS_EVENT_TYPE = os.getenv('event_type')
     else:
-        project = ''
-        obs_event_type = ''
-        obs_event_fields = ''
+        PROJECT = ''
+        OBS_EVENT_TYPE = ''
+        OBS_EVENT_FIELDS = ''
 
-    sys.exit(main(obs_event_fields))
+    sys.exit(main(OBS_EVENT_FIELDS))