Clean up OS family code

reviewable/pr18780/r1
Michael DeHaan 12 years ago
parent 268b09f075
commit 5fa0a01b9b

55
setup

@ -131,44 +131,16 @@ class Facts(object):
def get_distribution_facts(self): def get_distribution_facts(self):
# A list with OS Family members # A list with OS Family members
OSFAMILY = { OS_FAMILY = dict(
'RedHat' : 'RedHat', RedHat = 'RedHat', Fedora = 'RedHat', CentOS = 'RedHat', Scientific = 'RedHat',
'Fedora' : 'RedHat', SLC = 'RedHat', Ascendos = 'RedHat', CloudLinux = 'RedHat', PSBM = 'RedHat',
'CentOS' : 'RedHat', OracleLinux = 'RedHat', OVS = 'RedHat', OEL = 'RedHat', Amazon = 'RedHat',
'Scientific' : 'RedHat', XenServer = 'RedHat', Ubuntu = 'Debian', Debian = 'Debian', SLES = 'Suse',
'SLC' : 'RedHat', SLED = 'Suse', OpenSuSE = 'Suse', SuSE = 'Suse', Gentoo = 'Gentoo',
'Ascendos' : 'RedHat', Archlinux = 'Archlinux', Mandriva = 'Mandrake', Mandrake = 'Mandrake',
'CloudLinux' : 'RedHat', Solaris = 'Solaris', Nexenta = 'Solaris', OmniOS = 'Solaris', OpenIndiana = 'Solaris',
'PSBM' : 'RedHat', SmartOS = 'Solaris', AIX = 'AIX'
'OracleLinux' : 'RedHat', )
'OVS' : 'RedHat',
'OEL' : 'RedHat',
'Amazon' : 'RedHat',
'XenServer' : 'RedHat',
#
'Ubuntu' : 'Debian',
'Debian' : 'Debian',
#
'SLES' : 'Suse',
'SLED' : 'Suse',
'OpenSuSE' : 'Suse',
'SuSE' : 'Suse',
#
'Gentoo' : 'Gentoo',
#
'Archlinux' : 'Archlinux',
#
'Mandriva' : 'Mandrake',
'Mandrake' : 'Mandrake',
#
'Solaris' : 'Solaris',
'Nexenta' : 'Solaris',
'OmniOS' : 'Solaris',
'OpenIndiana' : 'Solaris',
'SmartOS' : 'Solaris',
#
'AIX' : 'AIX'
}
if self.facts['system'] == 'AIX': if self.facts['system'] == 'AIX':
self.facts['distribution'] = 'AIX' self.facts['distribution'] = 'AIX'
@ -200,10 +172,9 @@ class Facts(object):
else: else:
self.facts['distribution'] = name self.facts['distribution'] = name
# Find the family self.facts['os_family'] = self.facts['distribution']
self.facts['osfamily'] = self.facts['distribution'] if self.facts['distribution'] in OS_FAMILY:
if self.facts['distribution'] in OSFAMILY: self.facts['os_family'] = OS_FAMILY[self.facts['distribution']]
self.facts['osfamily'] = OSFAMILY[self.facts['distribution']]
def get_cmdline(self): def get_cmdline(self):
data = get_file_content('/proc/cmdline') data = get_file_content('/proc/cmdline')

Loading…
Cancel
Save