Skip to content

Commit

Permalink
dnf_config_manager: fix parsing for non-english locales (#9157)
Browse files Browse the repository at this point in the history
* dnf_config_manager: forces locale to 'C' when the module starts

* adds changelog fragment

* Apply suggestions from code review

Co-authored-by: Alexei Znamensky <[email protected]>

---------

Co-authored-by: Alexei Znamensky <[email protected]>
  • Loading branch information
shamilovstas and russoz authored Nov 20, 2024
1 parent 5a97158 commit 4b0d5cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/9157-fix-dnf_config_manager-locale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- dnf_config_manager - forces locale to ``C`` before module starts. If the locale was set to non-English, the output of the ``dnf config-manager`` could not be parsed (https://github.com/ansible-collections/community.general/pull/9157, https://github.com/ansible-collections/community.general/issues/9046).
1 change: 1 addition & 0 deletions plugins/modules/dnf_config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def main():
argument_spec=module_args,
supports_check_mode=True
)
module.run_command_environ_update = dict(LANGUAGE='C', LC_ALL='C')

if not os.path.exists(DNF_BIN):
module.fail_json(msg="%s was not found" % DNF_BIN)
Expand Down

0 comments on commit 4b0d5cb

Please sign in to comment.