1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00

[PR #11076/8b1d725f backport][stable-12] irc: use True instead of 1 (#11084)

irc: use True instead of 1 (#11076)

* irc: use True instead of 1

* add changelog frag

(cherry picked from commit 8b1d725fb2)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-11-10 20:34:57 +01:00 committed by GitHub
parent 1951f70c00
commit 1559a378b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- irc - use proper boolean value in loops (https://github.com/ansible-collections/community.general/pull/11076).

View file

@ -71,12 +71,12 @@ options:
channel:
type: str
description:
- Channel name. One of nick_to or channel needs to be set. When both are set, the message is sent to both of them.
- Channel name. One of O(nick_to) or O(channel) needs to be set. When both are set, the message is sent to both of them.
nick_to:
type: list
elements: str
description:
- A list of nicknames to send the message to. One of nick_to or channel needs to be set. When both are defined, the
- A list of nicknames to send the message to. One of O(nick_to) or O(channel) needs to be set. When both are defined, the
message is sent to both of them.
key:
type: str
@ -94,7 +94,7 @@ options:
use_tls:
description:
- Designates whether TLS/SSL should be used when connecting to the IRC server.
- O(use_tls) is available since community.general 8.1.0, before the option was exlusively called O(use_ssl). The latter
- O(use_tls) is available since community.general 8.1.0, before the option was exclusively called O(use_ssl). The latter
is now an alias of O(use_tls).
- B(Note:) for security reasons, you should always set O(use_tls=true) and O(validate_certs=true) whenever possible.
- The default of this option changed to V(true) in community.general 10.0.0.
@ -260,7 +260,7 @@ def send_msg(
irc.send(to_bytes(f"USER {nick} {nick} {nick} :ansible IRC\r\n"))
motd = ""
start = time.time()
while 1:
while True:
motd += to_native(irc.recv(1024))
# 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).
@ -280,7 +280,7 @@ def send_msg(
join = ""
start = time.time()
while 1:
while True:
join += to_native(irc.recv(1024))
if re.search(rf"^:\S+ 366 {nick} {channel} :", join, flags=re.M | re.I):
break