dnf: fix output parsing on non-English LANGUAGE systems (#78233) (#78241)

Fixes #78193

(cherry picked from commit 630616103e)
pull/78411/head
Martin Krizek 3 years ago committed by GitHub
parent 31db1a3a11
commit 63f6fa0714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- "dnf - fix output parsing on systems with ``LANGUAGE`` set to a language other than English (https://github.com/ansible/ansible/issues/78193)"

@ -554,7 +554,8 @@ class DnfModule(YumDnf):
def _ensure_dnf(self):
locale = get_best_parsable_locale(self.module)
os.environ['LC_ALL'] = os.environ['LC_MESSAGES'] = os.environ['LANG'] = locale
os.environ['LC_ALL'] = os.environ['LC_MESSAGES'] = locale
os.environ['LANGUAGE'] = os.environ['LANG'] = locale
global dnf
try:

Loading…
Cancel
Save