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:
parent
5d26477b94
commit
0691c9c099
1 changed files with 2 additions and 1 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue