From 3d6f5e6d3a67d6bd3cbd16f574ad921fa627cc69 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 15 May 2018 10:45:20 -0700 Subject: [PATCH] ptl-tool: skip empty comment body Signed-off-by: Patrick Donnelly --- src/script/ptl-tool.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/script/ptl-tool.py b/src/script/ptl-tool.py index 6c92bfae428f8..bc1338a792a4c 100755 --- a/src/script/ptl-tool.py +++ b/src/script/ptl-tool.py @@ -260,14 +260,15 @@ def build_branch(args): indications = set() for comment in [pr_req.json()]+comments.json()+reviews.json()+review_comments.json(): body = comment["body"] - url = comment["html_url"] - for m in BZ_MATCH.finditer(body): - log.info("[ {url} ] BZ cited: {cite}".format(url=url, cite=m.group(1))) - for m in TRACKER_MATCH.finditer(body): - log.info("[ {url} ] Ceph tracker cited: {cite}".format(url=url, cite=m.group(1))) - for indication in INDICATIONS: - for cap in indication.findall(comment["body"]): - indications.add(cap) + if body: + url = comment["html_url"] + for m in BZ_MATCH.finditer(body): + log.info("[ {url} ] BZ cited: {cite}".format(url=url, cite=m.group(1))) + for m in TRACKER_MATCH.finditer(body): + log.info("[ {url} ] Ceph tracker cited: {cite}".format(url=url, cite=m.group(1))) + for indication in INDICATIONS: + for cap in indication.findall(comment["body"]): + indications.add(cap) new_new_contributors = {} for review in reviews.json(): -- 2.47.3