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
8fb5e2c6
Commit
8fb5e2c6
authored
Mar 19, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5443 from nirvinehh/devel
irc module: Make default irc color none; add color none
parents
bf251e3d
8b4c9420
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
library/notification/irc
+8
-7
No files found.
library/notification/irc
View file @
8fb5e2c6
...
@@ -51,8 +51,8 @@ options:
...
@@ -51,8 +51,8 @@ options:
description:
description:
- Text color for the message. Default is black.
- Text color for the message. Default is black.
required: false
required: false
default:
black
default:
none
choices: [ "yellow", "red", "green", "blue", "black" ]
choices: [ "
none", "
yellow", "red", "green", "blue", "black" ]
channel:
channel:
description:
description:
- Channel name
- Channel name
...
@@ -94,7 +94,7 @@ from time import sleep
...
@@ -94,7 +94,7 @@ from time import sleep
def
send_msg
(
channel
,
msg
,
server
=
'localhost'
,
port
=
'6667'
,
def
send_msg
(
channel
,
msg
,
server
=
'localhost'
,
port
=
'6667'
,
nick
=
"ansible"
,
color
=
'
black
'
,
passwd
=
False
,
timeout
=
30
):
nick
=
"ansible"
,
color
=
'
none
'
,
passwd
=
False
,
timeout
=
30
):
'''send message to IRC'''
'''send message to IRC'''
colornumbers
=
{
colornumbers
=
{
...
@@ -107,10 +107,11 @@ def send_msg(channel, msg, server='localhost', port='6667',
...
@@ -107,10 +107,11 @@ def send_msg(channel, msg, server='localhost', port='6667',
try
:
try
:
colornumber
=
colornumbers
[
color
]
colornumber
=
colornumbers
[
color
]
colortext
=
"
\x03
"
+
colornumber
except
:
except
:
color
number
=
"01"
# black
color
text
=
""
message
=
"
\x03
"
+
colornumber
+
msg
message
=
colortext
+
msg
irc
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
irc
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
irc
.
connect
((
server
,
int
(
port
)))
irc
.
connect
((
server
,
int
(
port
)))
...
@@ -162,8 +163,8 @@ def main():
...
@@ -162,8 +163,8 @@ def main():
port
=
dict
(
default
=
6667
),
port
=
dict
(
default
=
6667
),
nick
=
dict
(
default
=
'ansible'
),
nick
=
dict
(
default
=
'ansible'
),
msg
=
dict
(
required
=
True
),
msg
=
dict
(
required
=
True
),
color
=
dict
(
default
=
"
black
"
,
choices
=
[
"yellow"
,
"red"
,
"green"
,
color
=
dict
(
default
=
"
none
"
,
choices
=
[
"yellow"
,
"red"
,
"green"
,
"blue"
,
"black"
]),
"blue"
,
"black"
,
"none"
]),
channel
=
dict
(
required
=
True
),
channel
=
dict
(
required
=
True
),
passwd
=
dict
(),
passwd
=
dict
(),
timeout
=
dict
(
type
=
'int'
,
default
=
30
)
timeout
=
dict
(
type
=
'int'
,
default
=
30
)
...
...
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