From ead733362f9aa18f85218e61d66a4e0797044b52 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 6 Dec 2013 11:39:39 -0600 Subject: [PATCH] module is not exposed to send_msg, but main() catches exceptions and uses module.fail_json --- library/notification/irc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/notification/irc b/library/notification/irc index 39a0fc8717a..11bdc4a95ec 100644 --- a/library/notification/irc +++ b/library/notification/irc @@ -125,8 +125,7 @@ def send_msg(channel, msg, server='localhost', port='6667', if re.search('^:\S+ 00[1-4] %s :' % nick, motd, flags=re.M): break elif time.time() - start > timeout: - module.fail_json(msg='Timeout waiting for IRC server welcome ' - 'response') + raise Exception('Timeout waiting for IRC server welcome response') time.sleep(0.5) irc.send('JOIN %s\r\n' % channel) @@ -137,7 +136,7 @@ def send_msg(channel, msg, server='localhost', port='6667', if re.search('^:\S+ 366 %s %s :' % (nick, channel), join, flags=re.M): break elif time.time() - start > timeout: - module.fail_json(msg='Timeout waiting for IRC JOIN response') + raise Exception('Timeout waiting for IRC JOIN response') time.sleep(0.5) irc.send('PRIVMSG %s :%s\r\n' % (channel, message))