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
pull/41546/merge
Ivica Kolenkaš 8 years ago committed by Abhijeet Kasurde
parent 5d26477b94
commit 0691c9c099

@ -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.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
@ -78,6 +78,7 @@ class LinuxHardware(Hardware):
def populate(self, collected_facts=None):
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)
memory_facts = self.get_memory_facts()

Loading…
Cancel
Save