-
Notifications
You must be signed in to change notification settings - Fork 57
ValueError: filedescriptor out of range in select()
little flying bear edited this page Dec 28, 2016
·
1 revision
This is a boresome question if you have hundreds of machines, the reason is python's select module. Though is's high-level, so small size for web.
Refer to https://github.com/Supervisor/supervisor/pull/129, I add a script to solve it.
- Install ansible-api normally
- Find the script in ansible libpath: plugins/connection/ssh.py
- Add code below:
from ansible.plugins.connection.multipoller import MultiPooler # import a new pooler
# find this line and comment it
# rfd, wfd, efd = select.select(rpipes, [], [], timeout)
# add codes for solving: filedescriptor out of range in select()
poller = MultiPooler.get()
for rpipe in rpipes:
poller.register_readable(rpipe)
rfd, wfd = poller.poll(timeout)
--- Ansible-API: Use ansible easily for developer ---