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.
This commit is contained in:
parent
3529b1cb33
commit
2493020d9f
1 changed files with 2 additions and 0 deletions
|
@ -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…
Reference in a new issue