mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-17 17:31:31 +00:00
Ensure standard locale in run_command (group3-batch3) (#11741)
* run_command locale group3 batch3: normalise to LANGUAGE=C, LC_ALL=C Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix changelog fragment: bugfixes, American English, separate code spans Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix changelog fragment: correct PR number (11741) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
936ab2ea56
commit
e59888dd7e
10 changed files with 22 additions and 13 deletions
|
|
@ -353,7 +353,7 @@ def main():
|
|||
global PKGIN_PATH
|
||||
PKGIN_PATH = module.get_bin_path("pkgin", True, ["/opt/local/bin"])
|
||||
|
||||
module.run_command_environ_update = dict(LANG="C", LC_ALL="C", LC_MESSAGES="C", LC_CTYPE="C")
|
||||
module.run_command_environ_update = dict(LANGUAGE="C", LC_ALL="C")
|
||||
|
||||
p = module.params
|
||||
|
||||
|
|
|
|||
|
|
@ -931,7 +931,7 @@ class RhsmPools:
|
|||
args += " --consumed"
|
||||
else:
|
||||
args += " --available"
|
||||
lang_env = dict(LANG="C", LC_ALL="C", LC_MESSAGES="C")
|
||||
lang_env = dict(LANGUAGE="C", LC_ALL="C")
|
||||
rc, stdout, stderr = self.module.run_command(args, check_rc=True, environ_update=lang_env)
|
||||
|
||||
products = []
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class Rhsm:
|
|||
self.module = module
|
||||
self.rhsm_bin = self.module.get_bin_path("subscription-manager", required=True)
|
||||
self.rhsm_kwargs = {
|
||||
"environ_update": dict(LANG="C", LC_ALL="C", LC_MESSAGES="C"),
|
||||
"environ_update": dict(LANGUAGE="C", LC_ALL="C"),
|
||||
"expand_user_and_vars": False,
|
||||
"use_unsafe_shell": False,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ def main():
|
|||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
module.run_command_environ_update = dict(LANG="C", LC_ALL="C", LC_MESSAGES="C", LC_CTYPE="C")
|
||||
module.run_command_environ_update = dict(LANGUAGE="C", LC_ALL="C")
|
||||
|
||||
state = module.params["state"]
|
||||
enabled = module.params["enabled"]
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ def main():
|
|||
signal = module.params.get("signal")
|
||||
|
||||
# we check error message for a pattern, so we need to make sure that's in C locale
|
||||
module.run_command_environ_update = dict(LANG="C", LC_ALL="C", LC_MESSAGES="C", LC_CTYPE="C")
|
||||
module.run_command_environ_update = dict(LANGUAGE="C", LC_ALL="C")
|
||||
|
||||
if supervisorctl_path:
|
||||
if os.path.exists(supervisorctl_path) and is_executable(supervisorctl_path):
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ def main():
|
|||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
module.run_command_environ_update = dict(LANG="C", LC_ALL="C", LC_MESSAGES="C", LC_CTYPE="C")
|
||||
module.run_command_environ_update = dict(LANGUAGE="C", LC_ALL="C")
|
||||
|
||||
state = module.params["state"]
|
||||
enabled = module.params["enabled"]
|
||||
|
|
|
|||
|
|
@ -395,7 +395,7 @@ def main():
|
|||
cmd = " ".join(map(itemgetter(-1), filter(itemgetter(0), cmd)))
|
||||
|
||||
cmds.append(cmd)
|
||||
(rc, out, err) = module.run_command(cmd, environ_update={"LANG": "C"})
|
||||
(rc, out, err) = module.run_command(cmd, environ_update={"LANGUAGE": "C", "LC_ALL": "C"})
|
||||
|
||||
if rc != 0 and not ignore_error:
|
||||
module.fail_json(msg=err or out, commands=cmds)
|
||||
|
|
|
|||
|
|
@ -624,7 +624,7 @@ def main():
|
|||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
module.run_command_environ_update = dict(LANG="C", LC_ALL="C", LC_MESSAGES="C")
|
||||
module.run_command_environ_update = dict(LANGUAGE="C", LC_ALL="C")
|
||||
|
||||
name = module.params["name"]
|
||||
state = module.params["state"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue