protect from the case of not passing an event

in moving to the event object, we could fail to pass an event,
make that ok for now. Can clean up and separate this later.

Change-Id: I33359cf437fb4617390ea8cd43d5b3e57aef3ce5
This commit is contained in:
Sean Dague 2014-01-23 14:44:27 -05:00
parent 84200edb88
commit 1fa614169b

View File

@ -123,17 +123,18 @@ class RecheckWatch(threading.Thread):
if self.ircbot: if self.ircbot:
self.ircbot.send(channel, msg) self.ircbot.send(channel, msg)
def _read(self, event, msg=""): def _read(self, event=None, msg=""):
for channel in self.channel_config.channels: for channel in self.channel_config.channels:
if msg: if msg:
if channel in self.channel_config.events['negative']: if channel in self.channel_config.events['negative']:
self.print_msg(channel, msg) self.print_msg(channel, msg)
elif event.bugs: elif event:
if channel in self.channel_config.events['positive']: if event.bugs:
self.error_found(channel, event) if channel in self.channel_config.events['positive']:
else: self.error_found(channel, event)
if channel in self.channel_config.events['negative']: else:
self.new_error(channel, event) if channel in self.channel_config.events['negative']:
self.new_error(channel, event)
def run(self): def run(self):
# Import here because it needs to happen after daemonization # Import here because it needs to happen after daemonization