summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAbhijeet Kasurde <akasurde@redhat.com>2021-05-17 14:37:11 +0530
committerGitHub <noreply@github.com>2021-05-17 04:07:11 -0500
commit66a9ea2f23d673a92c007a6f7ef6c793b407dd10 (patch)
treec8ea510c0541b68b23bac5622806d753cf8c851d /lib
parent162973d1a7a09932408a2744eb5f770b9fc5afb0 (diff)
downloadansible-66a9ea2f23d673a92c007a6f7ef6c793b407dd10.tar.gz
[bp-2.11] service - compare version without LooseVersion (#74618)
The distutils module is not shipped with SUNWPython on Solaris. It's in the SUNWPython-devel package. Do not use LooseVersion. Fixes: #74488 (cherry picked from commit 4d7dc15d4e1e214e5091abc554eddb6974b72830) Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/modules/service.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/modules/service.py b/lib/ansible/modules/service.py
index 59cd7e8113..056183be05 100644
--- a/lib/ansible/modules/service.py
+++ b/lib/ansible/modules/service.py
@@ -1355,8 +1355,8 @@ class SunOSService(Service):
# Support for synchronous restart/refresh is only supported on
# Oracle Solaris >= 11.2
for line in open('/etc/release', 'r').readlines():
- m = re.match(r'\s+Oracle Solaris (\d+\.\d+).*', line.rstrip())
- if m and m.groups()[0] >= 11.2:
+ m = re.match(r'\s+Oracle Solaris (\d+)\.(\d+).*', line.rstrip())
+ if m and m.groups() >= ('11', '2'):
return True
def get_service_status(self):