From ed332ea2c89e555e871d4fe7973d4e6a1291bc9a Mon Sep 17 00:00:00 2001 From: Hasan Wan Date: Mon, 20 Aug 2012 11:09:33 +0800 Subject: [PATCH] Post a comments when request is rejected Change-Id: I09261ef86d4a4434e4d338b6bcd7c10a80edba3a Signed-off-by: Hasan Wan --- request.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/request.py b/request.py index 0c82431..9944281 100644 --- a/request.py +++ b/request.py @@ -139,7 +139,7 @@ def request_accepted(data, gerrit, gitprj): def request_rejected(data, gerrit, gitprj): print '====request rejected====================================' - message = 'The SR (Submit Request) has been rejected to OBS %s project.\n' \ + message = 'The SR (Submit Request) has been *rejected* to OBS %s project.\n' \ '- Reviewer: %s\n' \ '- Comments: %s\n' \ '- Git project: %s\n' \ @@ -216,7 +216,8 @@ gerrit = Gerrit(GERRIT_HOSTNAME, GERRIT_USERNAME, GERRIT_SSHPORT) gitprj = git.Git('%s/%s' %(GIT_CACHE_DIR, data['git_project'])) if event_fields['type'] == 'OBS_SRCSRV_REQUEST_STATECHANGE': - pass + if event_fields['state'] == 'declined': + request_rejected(data, gerrit, gitprj) elif event_fields['type'] == 'OBS_SRCSRV_REQUEST_CREATE': request_created(data, gerrit, gitprj) elif event_fields['type'] == 'OBS_SRCSRV_REQUEST_ACCEPTED': -- 2.7.4