mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Fixes #29818: chkconfig command is not daemonized, uses run_command()
In the last commit I modified the code to run commands when they are daemonized. But the execution of "chkconfig" is not daemonized so it uses "self.module.run_command(cmd)". This commit set the default localize to allow proper screen scraping of chkconfig command.
This commit is contained in:
parent
516e18f4b8
commit
7255b6a151
1 changed files with 4 additions and 1 deletions
|
@ -206,7 +206,10 @@ class Service(object):
|
||||||
|
|
||||||
# Most things don't need to be daemonized
|
# Most things don't need to be daemonized
|
||||||
if not daemonize:
|
if not daemonize:
|
||||||
return self.module.run_command(cmd)
|
# chkconfig localizes messages and we're screen scraping so make
|
||||||
|
# sure we use the C locale
|
||||||
|
lang_env = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C')
|
||||||
|
return self.module.run_command(cmd, environ_update=lang_env)
|
||||||
|
|
||||||
# This is complex because daemonization is hard for people.
|
# This is complex because daemonization is hard for people.
|
||||||
# What we do is daemonize a part of this module, the daemon runs the
|
# What we do is daemonize a part of this module, the daemon runs the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue