mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Format /etc/locale.gen correctly on gen_locale
Prior to this change, the ``file.replace`` call matches an end-of-line character, which changes a file from: ``` ... # en_US.UTF-8 UTF-8 # en_ZA ISO-8859-1 ... ``` to ``` ... en_US.UTF-8 UTF-8# en_ZA ISO-8859-1 ... ``` which is incorrectly formatted -- the newline char being removed means the whole section after the whitespace is considered the charset. See http://www.man-online.org/page/5-locale.gen/. This may fix #24827.
This commit is contained in:
parent
a0e585f8f8
commit
1c133591e2
1 changed files with 1 additions and 1 deletions
|
@ -234,7 +234,7 @@ def gen_locale(locale, **kwargs):
|
|||
__salt__['file.replace'](
|
||||
'/etc/locale.gen',
|
||||
r'^\s*#\s*{0}\s*$'.format(locale),
|
||||
'{0}'.format(locale),
|
||||
'{0}\\n'.format(locale),
|
||||
append_if_not_found=True
|
||||
)
|
||||
elif on_ubuntu:
|
||||
|
|
Loading…
Add table
Reference in a new issue