]> Frank Brehm's Git Trees - pixelpark/puppetmaster-webhooks.git/commitdiff
Fixing lib/webhooks/__init__.py for the case not committers were found.
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 13 Feb 2017 15:03:22 +0000 (16:03 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 13 Feb 2017 15:03:22 +0000 (16:03 +0100)
lib/webhooks/__init__.py
lib/webhooks/deploy.py

index 52d46725ff8f2cef473dd93f405067cb8592c835..4bafe803e150073dc47c6d43071725de97093810 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/env python3
 # -*- coding: utf-8 -*-
 
-__version__ = '0.3.5'
+__version__ = '0.3.6'
 
 # vim: ts=4 et list
index 1552a4b3a9332d271ca193586f6991c2e30eb27e..ca32149aee2bd4404c5762dd9215e89ffd3bed5c 100644 (file)
@@ -580,11 +580,14 @@ class WebhookDeployApp(object):
             timestamp = datetime.datetime.strptime(ts_str, timeformat)
             email = commit['author']['email']
             committers.append((timestamp, email))
-        committers.sort()
-        if self.verbose > 1:
-            LOG.debug("Got committers: {}".format(pp(committers)))
 
-        self.mail_to_addresses.append(committers[-1][1])
+        if committers:
+            committers.sort()
+            if self.verbose > 1:
+                LOG.debug("Got committers: {}".format(pp(committers)))
+            self.mail_to_addresses.append(committers[-1][1])
+        else:
+            LOG.debug("No committers found to append a mail address.")
 
         if 'git_ssh_url' in self.json_data['project']:
             self.git_ssh_url = self.json_data['project']['git_ssh_url']