hacking: fix announce script version parsing (#71008)

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>
This commit is contained in:
Rick Elrod 2020-07-30 21:28:43 -05:00 committed by GitHub
parent f99f96ceb6
commit 75e8da0950
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 = []
for component in version.split('.'):
if not component.isdigit():
# Take everything up until the first non-numeric component
break
if 'rc' in component:
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))
return tuple(ver_split) >= (2, 10, 0)