This commit is contained in:
parent
fda09a75d3
commit
c282e4e00f
2 changed files with 8 additions and 6 deletions
|
@ -39,7 +39,6 @@ EXAMPLES = '''
|
|||
import os
|
||||
import socket
|
||||
import traceback
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
from ansible.module_utils.basic import (
|
||||
AnsibleModule,
|
||||
|
@ -567,10 +566,14 @@ class FedoraHostname(Hostname):
|
|||
class SLESHostname(Hostname):
|
||||
platform = 'Linux'
|
||||
distribution = 'Suse linux enterprise server '
|
||||
distribution_version = get_distribution_version()
|
||||
if distribution_version and LooseVersion("10") <= LooseVersion(distribution_version) <= LooseVersion("12"):
|
||||
strategy_class = SLESStrategy
|
||||
else:
|
||||
try:
|
||||
distribution_version = get_distribution_version()
|
||||
# cast to float may raise ValueError on non SLES, we use float for a little more safety over int
|
||||
if distribution_version and 10 <= float(distribution_version) <= 12:
|
||||
strategy_class = SLESStrategy
|
||||
else:
|
||||
raise ValueError()
|
||||
except ValueError:
|
||||
strategy_class = UnimplementedStrategy
|
||||
|
||||
|
||||
|
|
|
@ -5,4 +5,3 @@ lib/ansible/modules/cloud/webfaction/webfaction_domain.py
|
|||
lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py
|
||||
lib/ansible/modules/cloud/webfaction/webfaction_site.py
|
||||
lib/ansible/modules/packaging/os/yum_repository.py
|
||||
lib/ansible/modules/system/hostname.py
|
||||
|
|
Loading…
Reference in a new issue