Commit 2493020d by James Cammarata

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.
parent 3529b1cb
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment