Merge pull request #8146 from rmarchei/8102
fix get_distribution_version() on amazon linux
This commit is contained in:
commit
3492e8748e
2 changed files with 6 additions and 2 deletions
|
@ -185,6 +185,8 @@ def get_distribution_version():
|
|||
if platform.system() == 'Linux':
|
||||
try:
|
||||
distribution_version = platform.linux_distribution()[1]
|
||||
if not distribution_version and os.path.isfile('/etc/system-release'):
|
||||
distribution_version = platform.linux_distribution(supported_dists=['system'])[1]
|
||||
except:
|
||||
# FIXME: MethodMissing, I assume?
|
||||
distribution_version = platform.dist()[1]
|
||||
|
|
|
@ -299,7 +299,8 @@ class RedHat5Hostname(Hostname):
|
|||
class RedHatServerHostname(Hostname):
|
||||
platform = 'Linux'
|
||||
distribution = 'Red hat enterprise linux server'
|
||||
if LooseVersion(get_distribution_version()) >= LooseVersion("7"):
|
||||
distribution_version = get_distribution_version()
|
||||
if distribution_version and LooseVersion(distribution_version) >= LooseVersion("7"):
|
||||
strategy_class = FedoraStrategy
|
||||
else:
|
||||
strategy_class = RedHatStrategy
|
||||
|
@ -307,7 +308,8 @@ class RedHatServerHostname(Hostname):
|
|||
class RedHatWorkstationHostname(Hostname):
|
||||
platform = 'Linux'
|
||||
distribution = 'Red hat enterprise linux workstation'
|
||||
if LooseVersion(get_distribution_version()) >= LooseVersion("7"):
|
||||
distribution_version = get_distribution_version()
|
||||
if distribution_version and LooseVersion(distribution_version) >= LooseVersion("7"):
|
||||
strategy_class = FedoraStrategy
|
||||
else:
|
||||
strategy_class = RedHatStrategy
|
||||
|
|
Loading…
Reference in a new issue