From 52b582a7a4fceeb5901b38dae8c3c2a0e78f5b91 Mon Sep 17 00:00:00 2001 From: Brad House Date: Wed, 17 Apr 2019 18:55:43 -0400 Subject: [PATCH] modules/notification/irc: Fix channel joining for some IRC servers. (#55444) * Fix channel joining for some IRC servers. Some IRC servers may return the channel in a different case than requested. For instance, you might request "foo" but the server returns "FOO". The regular expression matching must be case-insensitive for the join response in order to handle this. * ansible style guidelines want spaces --- lib/ansible/modules/notification/irc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/notification/irc.py b/lib/ansible/modules/notification/irc.py index fe4d567123b..d007ea24976 100644 --- a/lib/ansible/modules/notification/irc.py +++ b/lib/ansible/modules/notification/irc.py @@ -213,7 +213,7 @@ def send_msg(msg, server='localhost', port='6667', channel=None, nick_to=None, k start = time.time() while 1: join += to_native(irc.recv(1024)) - if re.search(r'^:\S+ 366 %s %s :' % (nick, channel), join, flags=re.M): + if re.search(r'^:\S+ 366 %s %s :' % (nick, channel), join, flags=re.M | re.I): break elif time.time() - start > timeout: raise Exception('Timeout waiting for IRC JOIN response')