diff options
author | Christian Thiemann <mail@cthiemann.de> | 2015-05-24 02:05:38 +0200 |
---|---|---|
committer | Greg DeKoenigsberg <greg@eucalyptus.com> | 2015-06-16 11:33:11 -0400 |
commit | b527380c6ac0833bff84625c9d6534ac37b9fdfc (patch) | |
tree | 64b51a11ee6f7db3fc29c5e0c7d345010c08370c /system/alternatives.py | |
parent | 3761052597d67fe011485d055637505a0391ef51 (diff) | |
download | ansible-modules-extras-b527380c6ac0833bff84625c9d6534ac37b9fdfc.tar.gz |
Fix alternatives module in non-English locale
The alternatives module parses the output of update-alternatives, but the expected English phrases may not show up if the system locale is not English. Setting LC_ALL=C when invoking update-alternatives fixes this problem.
Diffstat (limited to 'system/alternatives.py')
-rw-r--r-- | system/alternatives.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/system/alternatives.py b/system/alternatives.py index c298afc2..06d9bea2 100644 --- a/system/alternatives.py +++ b/system/alternatives.py @@ -85,7 +85,7 @@ def main(): # Run `update-alternatives --display <name>` to find existing alternatives (rc, display_output, _) = module.run_command( - [UPDATE_ALTERNATIVES, '--display', name] + ['env', 'LC_ALL=C', UPDATE_ALTERNATIVES, '--display', name] ) if rc == 0: @@ -106,7 +106,7 @@ def main(): # This is only compatible on Debian-based systems, as the other # alternatives don't have --query available rc, query_output, _ = module.run_command( - [UPDATE_ALTERNATIVES, '--query', name] + ['env', 'LC_ALL=C', UPDATE_ALTERNATIVES, '--query', name] ) if rc == 0: for line in query_output.splitlines(): |