hacking: fix announce script version parsing (#71008) (#71893)

Change:
- Fix a bug where rc/beta versions throw off the "is this an
  ansible-base release"? check.

Test Plan:
- Used it for 2.10.0rc4

Signed-off-by: Rick Elrod <rick@elrod.me>
(cherry picked from commit 75e8da0950)
This commit is contained in:
Rick Elrod 2020-09-23 16:16:52 -05:00 committed by GitHub
parent 77408dccab
commit 806acf9cd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -235,8 +235,11 @@ def is_ansible_base(version):
ver_split = [] ver_split = []
for component in version.split('.'): for component in version.split('.'):
if not component.isdigit(): if not component.isdigit():
# Take everything up until the first non-numeric component if 'rc' in component:
break ver_split.append(int(component.split('rc')[0]))
if 'b' in component:
ver_split.append(int(component.split('b')[0]))
continue
ver_split.append(int(component)) ver_split.append(int(component))
return tuple(ver_split) >= (2, 10, 0) return tuple(ver_split) >= (2, 10, 0)