diff --git a/stackalytics/processor/utils.py b/stackalytics/processor/utils.py index 37ec6e4ec..27913c9c4 100644 --- a/stackalytics/processor/utils.py +++ b/stackalytics/processor/utils.py @@ -50,7 +50,9 @@ def week_to_date(week): def check_email_validity(email): - return re.match(r'[\w\d_\.-]+@([\w\d_\.-]+\.)+[\w]+', email) + if email: + return re.match(r'[\w\d_\.-]+@([\w\d_\.-]+\.)+[\w]+', email) + return False def read_uri(uri): diff --git a/stackalytics/processor/vcs.py b/stackalytics/processor/vcs.py index 4d74402bd..75d6b13a7 100644 --- a/stackalytics/processor/vcs.py +++ b/stackalytics/processor/vcs.py @@ -20,6 +20,7 @@ import re import sh from stackalytics.openstack.common import log as logging +from stackalytics.processor import utils LOG = logging.getLogger(__name__) @@ -149,6 +150,9 @@ class Git(Vcs): commit[param[0]] = unicode(rec.group(i), 'utf8') i += 1 + if not utils.check_email_validity(commit['author_email']): + continue + commit['files_changed'] = int(rec.group(i)) i += 1 lines_changed_group = rec.group(i)