fix locale on opensuse and suse #27438

This commit is contained in:
Niels Abspoel 2015-09-28 22:35:41 +02:00
parent 382a53403f
commit a8f2dad1be

View file

@ -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: