mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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 os
|
||||||
import socket
|
import socket
|
||||||
import traceback
|
import traceback
|
||||||
from distutils.version import LooseVersion
|
|
||||||
|
|
||||||
from ansible.module_utils.basic import (
|
from ansible.module_utils.basic import (
|
||||||
AnsibleModule,
|
AnsibleModule,
|
||||||
|
@ -567,10 +566,14 @@ class FedoraHostname(Hostname):
|
||||||
class SLESHostname(Hostname):
|
class SLESHostname(Hostname):
|
||||||
platform = 'Linux'
|
platform = 'Linux'
|
||||||
distribution = 'Suse linux enterprise server '
|
distribution = 'Suse linux enterprise server '
|
||||||
|
try:
|
||||||
distribution_version = get_distribution_version()
|
distribution_version = get_distribution_version()
|
||||||
if distribution_version and LooseVersion("10") <= LooseVersion(distribution_version) <= LooseVersion("12"):
|
# 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
|
strategy_class = SLESStrategy
|
||||||
else:
|
else:
|
||||||
|
raise ValueError()
|
||||||
|
except ValueError:
|
||||||
strategy_class = UnimplementedStrategy
|
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_mailbox.py
|
||||||
lib/ansible/modules/cloud/webfaction/webfaction_site.py
|
lib/ansible/modules/cloud/webfaction/webfaction_site.py
|
||||||
lib/ansible/modules/packaging/os/yum_repository.py
|
lib/ansible/modules/packaging/os/yum_repository.py
|
||||||
lib/ansible/modules/system/hostname.py
|
|
||||||
|
|
Loading…
Reference in a new issue