diff options
author | Toshio Kuratomi <toshio@fedoraproject.org> | 2016-02-07 12:46:41 -0800 |
---|---|---|
committer | Toshio Kuratomi <toshio@fedoraproject.org> | 2016-02-07 12:48:41 -0800 |
commit | 2e46c086aeae71e76f21138713cfffa50e3faaa6 (patch) | |
tree | 3357ef7caa2869746f0e2e4bb8437d67dd09e5aa /source_control/git.py | |
parent | 4089f4af308195b5f43aa8a2d5d00a102630359e (diff) | |
download | ansible-modules-core-2e46c086aeae71e76f21138713cfffa50e3faaa6.tar.gz |
Since we screenscrape output from git to tell us information we need to use the C locale when running commands.
Using another locale would mean that we get information that may have
the strings that we are looking for.
Fixes #2449
Fixes #2462
Diffstat (limited to 'source_control/git.py')
-rw-r--r-- | source_control/git.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source_control/git.py b/source_control/git.py index 2d3d1542..dc8fe203 100644 --- a/source_control/git.py +++ b/source_control/git.py @@ -684,6 +684,10 @@ def main(): key_file = module.params['key_file'] ssh_opts = module.params['ssh_opts'] + # We screenscrape a huge amount of git commands so use C locale anytime we + # call run_command() + module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C', LC_CTYPE='C') + gitconfig = None if not dest and allow_clone: module.fail_json(msg="the destination directory must be specified unless clone=no") @@ -812,4 +816,5 @@ def main(): from ansible.module_utils.basic import * from ansible.module_utils.known_hosts import * -main() +if __name__ == '__main__': + main() |