From 5bf36cc0d572f57c1356ac3eebba7079e99606fd Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 07 2017 08:53:35 +0000 Subject: Increase the logging in the milter to help figuring out issues in the future Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure-milters/comment_email_milter.py b/pagure-milters/comment_email_milter.py index 477cdf4..0b51ee6 100644 --- a/pagure-milters/comment_email_milter.py +++ b/pagure-milters/comment_email_milter.py @@ -184,11 +184,14 @@ class PagureMilter(Milter.Base): if url.endswith('/'): url = url[:-1] url = '%s/pv/ticket/comment/' % url + self.log('Calling URL: %s', % url) req = requests.put(url, data=data) if req.status_code == 200: self.log('Comment added') return Milter.ACCEPT - self.log('Could not add the comment to pagure') + self.log('Could not add the comment to ticket to pagure') + self.log(req.text) + return Milter.CONTINUE def handle_request_email(self, emailobj, msg_id): @@ -212,9 +215,15 @@ class PagureMilter(Milter.Base): if url.endswith('/'): url = url[:-1] url = '%s/pv/pull-request/comment/' % url + self.log('Calling URL: %s', % url) req = requests.put(url, data=data) + if req.status_code == 200: + self.log('Comment added on PR') + return Milter.ACCEPT + self.log('Could not add the comment to PR to pagure') + self.log(req.text) - return Milter.ACCEPT + return Milter.CONTINUE def background():