Skip to content

Commit

Permalink
service: compare version without LooseVersion
Browse files Browse the repository at this point in the history
The distutils module is not shipped with SUNWPython on Solaris.
It's in the SUNWPython-devel package. Do not use LooseVersion.

Fixes: #74488

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
  • Loading branch information
Akasurde committed Apr 30, 2021
1 parent f40ab25 commit 177dacc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/74488_solaris_looseversion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- service - compare version without LooseVersion API (https://github.com/ansible/ansible/issues/74488).
2 changes: 1 addition & 1 deletion lib/ansible/modules/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ def svcadm_supports_sync(self):
# 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 LooseVersion(m.groups()[0]) >= LooseVersion('11.2'):
if m and float(m.groups()[0]) >= 11.2:
return True

def get_service_status(self):
Expand Down

0 comments on commit 177dacc

Please sign in to comment.