Skip to content

Commit

Permalink
Fix traceback in release helper
Browse files Browse the repository at this point in the history
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 <module>
    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'
  • Loading branch information
jan-cerny committed Jun 15, 2023
1 parent f84884d commit d525b31
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utils/release_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')

Expand Down

0 comments on commit d525b31

Please sign in to comment.