mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
use file.replace instead of file.sed
This commit is contained in:
parent
123daf3090
commit
362e8c5ce0
@ -132,11 +132,11 @@ def set_locale(locale):
|
|||||||
__salt__['file.append']('/etc/sysconfig/i18n',
|
__salt__['file.append']('/etc/sysconfig/i18n',
|
||||||
'"\nLANG={0}"'.format(locale))
|
'"\nLANG={0}"'.format(locale))
|
||||||
else:
|
else:
|
||||||
__salt__['file.sed'](
|
__salt__['file.replace'](
|
||||||
'/etc/sysconfig/i18n', '^LANG=.*', 'LANG="{0}"'.format(locale)
|
'/etc/sysconfig/i18n', '^LANG=.*', 'LANG="{0}"'.format(locale)
|
||||||
)
|
)
|
||||||
elif 'Debian' in __grains__['os_family']:
|
elif 'Debian' in __grains__['os_family']:
|
||||||
__salt__['file.sed'](
|
__salt__['file.replace'](
|
||||||
'/etc/default/locale', '^LANG=.*', 'LANG="{0}"'.format(locale)
|
'/etc/default/locale', '^LANG=.*', 'LANG="{0}"'.format(locale)
|
||||||
)
|
)
|
||||||
if __salt__['cmd.retcode']('grep "^LANG=" /etc/default/locale') != 0:
|
if __salt__['cmd.retcode']('grep "^LANG=" /etc/default/locale') != 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user