Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
1211160c
Commit
1211160c
authored
Mar 16, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6289 from rawtaz/fix-irc-nicklen
Make irc module accept the nick being shortened by the server.
parents
58eec2e4
dd62de03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
library/notification/irc
+6
-2
No files found.
library/notification/irc
View file @
1211160c
...
...
@@ -39,7 +39,7 @@ options:
default: 6667
nick:
description:
- Nickname
- Nickname
. May be shortened, depending on server's NICKLEN setting.
required: false
default: ansible
msg:
...
...
@@ -122,7 +122,11 @@ def send_msg(channel, msg, server='localhost', port='6667',
start
=
time
.
time
()
while
1
:
motd
+=
irc
.
recv
(
1024
)
if
re
.
search
(
'^:
\
S+ 00[1-4]
%
s :'
%
nick
,
motd
,
flags
=
re
.
M
):
# The server might send back a shorter nick than we specified (due to NICKLEN),
# so grab that and use it from now on (assuming we find the 00[1-4] response).
match
=
re
.
search
(
'^:
\
S+ 00[1-4] (?P<nick>
\
S+) :'
,
motd
,
flags
=
re
.
M
)
if
match
:
nick
=
match
.
group
(
'nick'
)
break
elif
time
.
time
()
-
start
>
timeout
:
raise
Exception
(
'Timeout waiting for IRC server welcome response'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment