mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix locale on opensuse and suse #27438
This commit is contained in:
parent
382a53403f
commit
a8f2dad1be
1 changed files with 11 additions and 0 deletions
|
@ -124,6 +124,8 @@ def get_locale():
|
|||
return _locale_get()
|
||||
elif 'RedHat' in __grains__['os_family']:
|
||||
cmd = 'grep "^LANG=" /etc/sysconfig/i18n'
|
||||
elif 'Suse' in __grains__['os_family']:
|
||||
cmd = 'grep "^RC_LANG" /etc/sysconfig/language'
|
||||
elif 'Debian' in __grains__['os_family']:
|
||||
cmd = 'grep "^LANG=" /etc/default/locale'
|
||||
elif 'Gentoo' in __grains__['os_family']:
|
||||
|
@ -157,6 +159,15 @@ def set_locale(locale):
|
|||
'LANG="{0}"'.format(locale),
|
||||
append_if_not_found=True
|
||||
)
|
||||
elif 'Suse' in __grains__['os_family']:
|
||||
if not __salt__['file.file_exists']('/etc/sysconfig/language'):
|
||||
__salt__['file.touch']('/etc/sysconfig/language')
|
||||
__salt__['file.replace'](
|
||||
'/etc/sysconfig/language',
|
||||
'^RC_LANG=.*',
|
||||
'RC_LANG="{0}"'.format(locale),
|
||||
append_if_not_found=True
|
||||
)
|
||||
elif 'Debian' in __grains__['os_family']:
|
||||
update_locale = salt.utils.which('update-locale')
|
||||
if update_locale is None:
|
||||
|
|
Loading…
Add table
Reference in a new issue