From 65248ec118949b2aa6877bd7cda23ec24fa243c4 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Aug 15 2018 22:41:39 +0000 Subject: Only send email reports for updates composes on error Signed-off-by: Adam Williamson --- diff --git a/checkcomp_consumer.py b/checkcomp_consumer.py index c49f152..8ffbd08 100755 --- a/checkcomp_consumer.py +++ b/checkcomp_consumer.py @@ -62,6 +62,11 @@ class CheckComposeConsumer(fedmsg.consumers.FedmsgConsumer): if not self.checkcomp_prod: # don't send the email args.extend(('--email-from', '')) + if '-updates-' in compose: + # for updates composes, only send mail on error. in a way + # we should do this via the configuration mechanism, but + # it turns out to be kind of a giant PITA, this is easier. + args.append('--email-error') args.append(compose) self.log.info("%s: Running compose-check for %s", self.__class__.__name__, compose) subprocess.Popen(args)