1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

setting LANG, LC_ALL and LC_NUMERIC to C (#41544)

* This forces the fact gathering commands to use C locale, preventing
weird locale issues such as different separator etc
This commit is contained in:
Ivica Kolenkaš 2018-06-15 14:25:54 +02:00 committed by Abhijeet Kasurde
parent 5d26477b94
commit 0691c9c099

View file

@ -31,7 +31,7 @@ from ansible.module_utils.basic import bytes_to_human
from ansible.module_utils.facts.hardware.base import Hardware, HardwareCollector from ansible.module_utils.facts.hardware.base import Hardware, HardwareCollector
from ansible.module_utils.facts.utils import get_file_content, get_file_lines, get_mount_size from ansible.module_utils.facts.utils import get_file_content, get_file_lines, get_mount_size
# import this as a module to ensure we get the same module isntance # import this as a module to ensure we get the same module instance
from ansible.module_utils.facts import timeout from ansible.module_utils.facts import timeout
@ -78,6 +78,7 @@ class LinuxHardware(Hardware):
def populate(self, collected_facts=None): def populate(self, collected_facts=None):
hardware_facts = {} hardware_facts = {}
self.module.run_command_environ_update = {'LANG': 'C', 'LC_ALL': 'C', 'LC_NUMERIC': 'C'}
cpu_facts = self.get_cpu_facts(collected_facts=collected_facts) cpu_facts = self.get_cpu_facts(collected_facts=collected_facts)
memory_facts = self.get_memory_facts() memory_facts = self.get_memory_facts()