Skip to content

Commit

Permalink
Support Katello naming in Redmine versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Nov 6, 2023
1 parent 25a231f commit bcfafa2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion redmine
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ def create_version(args: argparse.Namespace) -> None:
def set_status_version(args: argparse.Namespace) -> None:
redmine = get_redmine()
versions = redmine.version.filter(project_id=args.project_id)
# Katello uses 'Katello x.y.z' instead of 'x.y.z'
matches = (args.name, f'{args.project_id.capitalize()} {args.name})')
try:
version = [version for version in versions if version.name == args.name][0]
version = [version for version in versions if version.name in matches][0]
except IndexError:
raise SystemExit('Version not found')

Expand Down

0 comments on commit bcfafa2

Please sign in to comment.