From: hyokeun Date: Fri, 18 Aug 2017 05:35:08 +0000 (+0900) Subject: TPE-180 Skip deleted SR tag processing in requests job X-Git-Tag: submit/trunk/20190927.012743~326^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49641385b02d8cbc89ea7d2c270bc288d22e9bff;p=services%2Fjenkins-scripts.git TPE-180 Skip deleted SR tag processing in requests job Problem: If developer removed SR tag before accept/reject it, the requests job will broke due to fail to search tag info. Fix: Skip deleted tag. Change-Id: Iba6bb4f9e05a0c36eec206602545b0dbeb790cf8 --- diff --git a/job_request.py b/job_request.py index 2e50f40..2fdfeb9 100644 --- a/job_request.py +++ b/job_request.py @@ -65,7 +65,12 @@ def tag_info(prj, tag): exit(1) mygit = Git(os.path.join(os.getenv('WORKSPACE'), prj)) - return mygit.get_tag(tag) + try: + tag_data = mygit.get_tag(tag) + return mygit.get_tag(tag) + except Exception as err: + print repr(err) + return None def obs_git_data(event_fields): """Put obs and git data into a dict""" @@ -143,10 +148,11 @@ def obs_git_data(event_fields): except Exception as err: print 'Warning: not able to find package name from description' tag = tag_info(project, entry['GIT_TAG']) - tag.update({'GIT_PROJECT': project, - 'OBS_REQ_PKG_SRC': obs_req_pkg_name, - 'OBS_REQ_PKG': obs_req_pkg_name,}) - projects_list.append(tag) + if tag: + tag.update({'GIT_PROJECT': project, + 'OBS_REQ_PKG_SRC': obs_req_pkg_name, + 'OBS_REQ_PKG': obs_req_pkg_name,}) + projects_list.append(tag) else: print '-------------------------------------' print "FATAL ERROR: Invalid rquest info: the request might be"\