Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service: compare version without LooseVersion #74508

Merged
merged 1 commit into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).
4 changes: 2 additions & 2 deletions lib/ansible/modules/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1355,8 +1355,8 @@ def svcadm_supports_sync(self):
# 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 LooseVersion(m.groups()[0]) >= LooseVersion('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):
Expand Down