mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
473 B
Python
15 lines
473 B
Python
6 years ago
|
"""Early initialization for ansible-test before most other imports have been performed."""
|
||
|
|
||
|
import resource
|
||
|
|
||
|
from lib.constants import (
|
||
|
SOFT_RLIMIT_NOFILE,
|
||
|
)
|
||
|
|
||
|
CURRENT_RLIMIT_NOFILE = resource.getrlimit(resource.RLIMIT_NOFILE)
|
||
|
DESIRED_RLIMIT_NOFILE = (SOFT_RLIMIT_NOFILE, CURRENT_RLIMIT_NOFILE[1])
|
||
|
|
||
|
if DESIRED_RLIMIT_NOFILE < CURRENT_RLIMIT_NOFILE:
|
||
|
resource.setrlimit(resource.RLIMIT_NOFILE, DESIRED_RLIMIT_NOFILE)
|
||
|
CURRENT_RLIMIT_NOFILE = DESIRED_RLIMIT_NOFILE
|