From 75e8da09501dd9de565cb7854205b8e06615565f Mon Sep 17 00:00:00 2001 From: Rick Elrod Date: Thu, 30 Jul 2020 21:28:43 -0500 Subject: [PATCH] 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 --- hacking/build_library/build_ansible/announce.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hacking/build_library/build_ansible/announce.py b/hacking/build_library/build_ansible/announce.py index de993a0f451..c245bfb97b9 100644 --- a/hacking/build_library/build_ansible/announce.py +++ b/hacking/build_library/build_ansible/announce.py @@ -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)