More reliably fetch locale LANG env

This commit is contained in:
Adam Bolte 2013-07-22 15:18:38 +10:00
parent 15557f7134
commit 4e0aa45163

View File

@ -88,9 +88,9 @@ def get_locale():
if 'Arch' in __grains__['os_family']:
return _localectl_get()
elif 'RedHat' in __grains__['os_family']:
cmd = 'grep LANG /etc/sysconfig/i18n | grep -vE "^#"'
cmd = 'grep "^LANG=" /etc/sysconfig/i18n'
elif 'Debian' in __grains__['os_family']:
cmd = 'grep LANG /etc/default/locale | grep -vE "^#"'
cmd = 'grep "^LANG=" /etc/default/locale'
elif 'Gentoo' in __grains__['os_family']:
cmd = 'eselect --brief locale show'
return __salt__['cmd.run'](cmd).strip()