rhsm_release: Fix the issue that rhsm_release module considers 8, 7Client and 7Workstation as invalid releases (#2571) (#2606)

* rhsm_release: Fix the issue that rhsm_release module considers 8, 7Client and 7Workstation as invalid releases.

* Fix the unit test error: The new release_matcher could pass a wider range of patterns but that would not cause extra issue to the whole module.

* Submit the changelog fragment.

* Update changelogs/fragments/2571-rhsm_release-fix-release_matcher.yaml

Co-authored-by: Amin Vakil <info@aminvakil.com>

Co-authored-by: Amin Vakil <info@aminvakil.com>
(cherry picked from commit 593d622438)

Co-authored-by: Tong He <68936428+unnecessary-username@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-05-24 20:28:18 +00:00 committed by GitHub
parent c12be67a69
commit 113e7cdfa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -56,9 +56,9 @@ from ansible.module_utils.basic import AnsibleModule
import re
# Matches release-like values such as 7.2, 6.10, 10Server,
# but rejects unlikely values, like 100Server, 100.0, 1.100, etc.
release_matcher = re.compile(r'\b\d{1,2}(?:\.\d{1,2}|Server)\b')
# Matches release-like values such as 7.2, 5.10, 6Server, 8
# but rejects unlikely values, like 100Server, 1.100, 7server etc.
release_matcher = re.compile(r'\b\d{1,2}(?:\.\d{1,2}|Server|Client|Workstation|)\b')
def _sm_release(module, *args):