From d525b31ced3342099455cad90a7eb2d5c941aa22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= Date: Thu, 15 Jun 2023 13:02:06 +0200 Subject: [PATCH] Fix traceback in release helper The get_old_stabilization_branch returns a list. The function remove_old_stabilization_branch needs 2 arguments. Addressing: [jcerny@fedora utils{stabilization-v0.1.68}]$ ./release_helper.py -c ~/secret.ini -r ComplianceAsCode/content cleanup --branch Traceback (most recent call last): File "/home/jcerny/work/git/scap-security-guide/utils/./release_helper.py", line 780, in main() File "/home/jcerny/work/git/scap-security-guide/utils/./release_helper.py", line 776, in main subcmds[args.subcmd](repo, args) File "/home/jcerny/work/git/scap-security-guide/utils/./release_helper.py", line 638, in cleanup remove_old_stabilization_branch(branch_to_remove) TypeError: remove_old_stabilization_branch() missing 1 required positional argument: 'branch' --- utils/release_helper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/release_helper.py b/utils/release_helper.py index 0485310eb89..9b9ed9ed011 100755 --- a/utils/release_helper.py +++ b/utils/release_helper.py @@ -633,9 +633,10 @@ def stats(repo, args): def cleanup(repo, args) -> None: if args.branch: - branch_to_remove = get_old_stabilization_branch(repo) - if branch_to_remove: - remove_old_stabilization_branch(branch_to_remove) + branches_to_remove = get_old_stabilization_branch(repo) + if branches_to_remove: + for branch in branches_to_remove: + remove_old_stabilization_branch(repo, branch) else: print('Great! There is no branch to be removed.')