mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
Set LANG in module_common.py
Add constant DEFAULT_MODULE_LANG that defaults to C. Can be set via environment variable ANSIBLE_MODULE_LANG or configuration variable module_lang. Updated test-module to have same behavior.
This commit is contained in:
parent
dd5a8474f8
commit
6a68d3813f
4 changed files with 8 additions and 0 deletions
|
@ -17,12 +17,14 @@
|
|||
|
||||
REPLACER = "#<<INCLUDE_ANSIBLE_MODULE_COMMON>>"
|
||||
REPLACER_ARGS = "<<INCLUDE_ANSIBLE_MODULE_ARGS>>"
|
||||
REPLACER_LANG = "<<INCLUDE_ANSIBLE_MODULE_LANG>>"
|
||||
|
||||
MODULE_COMMON = """
|
||||
|
||||
# == BEGIN DYNAMICALLY INSERTED CODE ==
|
||||
|
||||
MODULE_ARGS = <<INCLUDE_ANSIBLE_MODULE_ARGS>>
|
||||
MODULE_LANG = <<INCLUDE_ANSIBLE_MODULE_LANG>>
|
||||
|
||||
BOOLEANS_TRUE = ['yes', 'on', '1', 'true', 1]
|
||||
BOOLEANS_FALSE = ['no', 'off', '0', 'false', 0]
|
||||
|
@ -143,6 +145,7 @@ class AnsibleModule(object):
|
|||
if add_file_common_args:
|
||||
self.argument_spec.update(FILE_COMMON_ARGUMENTS)
|
||||
|
||||
os.environ['LANG'] = MODULE_LANG
|
||||
(self.params, self.args) = self._load_params()
|
||||
|
||||
self._legal_inputs = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue