module_utils - Fix changing value while iterating. (#78501)

pull/78518/head
Matt Clay 2 years ago committed by GitHub
parent 0a199a07ed
commit 2d2839b234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- module_utils.service - daemonize - Avoid modifying the list of file descriptors while iterating over it.

@ -212,7 +212,7 @@ def daemonize(module, cmd):
while fds:
rfd, wfd, efd = select.select(fds, [], fds, 1)
if (rfd + wfd + efd) or p.poll():
for out in fds:
for out in list(fds):
if out in rfd:
data = os.read(out.fileno(), chunk)
if not data:

Loading…
Cancel
Save