mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix LooseVersion exception with empty distribution_version
This commit is contained in:
parent
909955f2e2
commit
8904c61932
1 changed files with 4 additions and 2 deletions
|
@ -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