Fix get_distribution() for platforms that may have spaces

The new CentOS 7 beta lists the distribution as "CentOS Linux", which
breaks the distribution detection and class loading. This patch fixes
that by taking just the first entry in the string when a space is
detected.
pull/6977/merge
James Cammarata 10 years ago
parent 3529b1cb33
commit 2493020d9f

@ -129,6 +129,8 @@ def get_distribution():
if platform.system() == 'Linux':
try:
distribution = platform.linux_distribution()[0].capitalize()
if " " in distribution:
distribution = distribution.split()[0]
if not distribution and os.path.isfile('/etc/system-release'):
distribution = platform.linux_distribution(supported_dists=['system'])[0].capitalize()
if 'Amazon' in distribution:

Loading…
Cancel
Save