saltstack/salt — Issue #280: CentOS incorrectly detected as Red Hat
Author: mdfranz
Created: 2011-11-26 21:12:09+00:00
State: open

[root@centos6-68 /]# cat /etc/redhat-release
CentOS Linux release 6.0 (Final)

It is a capitalization issue...

elif os.path.isfile('/etc/redhat-release'):
data = open('/etc/redhat-release', 'r').read()
if data.count('centos'):
grains['os'] = 'CentOS'
elif data.count('scientific'):
grains['os'] = 'Scientific'
else:

'cpuarch': 'x86_64',
'kernelrelease': '2.6.32-042stab039.11',
'os': 'RedHat',
'path': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin',
'ps': 'ps -ef',
'virtual': 'openvzve'}}