From 8ab51fa9c3459ce9b3da429ad4131e4e47d72151 Mon Sep 17 00:00:00 2001 From: Lingchaox Xin Date: Tue, 2 Jul 2013 15:12:07 +0800 Subject: [PATCH] Pylint for job_jobs_dispatcher.py Change-Id: Iaa8150a9f03db2030549791823ccebef03979df8 --- job_jobs_dispatcher.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/job_jobs_dispatcher.py b/job_jobs_dispatcher.py index e437da7..31f725e 100755 --- a/job_jobs_dispatcher.py +++ b/job_jobs_dispatcher.py @@ -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)) -- 2.7.4