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:
David Beitey 2015-07-10 15:09:06 +10:00 committed by rallytime
parent 2f0f59b6cb
commit 44d44ec574

View file

@ -286,7 +286,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: