Merge pull request #2524 from archtaku/develop

Fix LSB distro detection
This commit is contained in:
Jeff Schroeder 2012-11-11 16:38:12 -08:00
commit 0f660b3644

View File

@ -502,9 +502,11 @@ def os_data():
# It's worth noting that Ubuntu has patched their Python distribution
# so that platform.linux_distribution() does the /etc/lsb-release
# parsing, but we do it anyway here for the sake for full portability.
grains['osfullname'] = grains.get('lsb_distrib_id', osname)
grains['osrelease'] = grains.get('lsb_distrib_release', osrelease)
grains['oscodename'] = grains.get('lsb_distrib_codename', oscodename)
grains['osfullname'] = grains.get('lsb_distrib_id', osname).strip()
grains['osrelease'] = grains.get('lsb_distrib_release',
osrelease).strip()
grains['oscodename'] = grains.get('lsb_distrib_codename',
oscodename).strip()
# return the first ten characters with no spaces, lowercased
shortname = grains['osfullname'].replace(' ', '').lower()[:10]
# this maps the long names from the /etc/DISTRO-release files to the