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

* 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>
This commit is contained in:
Tong He 2021-05-25 03:59:52 +08:00 committed by GitHub
commit 593d622438
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -125,13 +125,12 @@ class RhsmRepositoryReleaseModuleTestCase(ModuleTestCase):
def test_release_matcher(self):
# throw a few values at the release matcher -- only sane_values should match
sane_values = ['1Server', '10Server', '1.10', '10.0']
sane_values = ['1Server', '1Client', '10Server', '1.10', '10.0', '9']
insane_values = [
'6server', # lowercase 's'
'100Server', # excessively long 'x' component
'100.0', # excessively long 'x' component
'6.100', # excessively long 'y' component
'100.100', # excessively long 'x' and 'y' components
'+.-', # illegal characters
]
matches = self.module.release_matcher.findall(' '.join(sane_values + insane_values))