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>
pull/71033/head
Rick Elrod 4 years ago committed by GitHub
parent f99f96ceb6
commit 75e8da0950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save