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.
pull/40499/head
Adrian Lopez 6 years ago committed by Brian Coca
parent 516e18f4b8
commit 7255b6a151

@ -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…
Cancel
Save