Skip to content

Commit

Permalink
Nethsm: fix add-key command
Browse files Browse the repository at this point in the history
The mechanism list requires ending with an empty string, but click did not accept that
  • Loading branch information
sosthene-nitrokey committed Feb 25, 2025
1 parent 22acf35 commit 9deeec6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pynitrokey/cli/nethsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,14 @@ def prompt_mechanisms(type: str) -> list[str]:
show_choices=False,
show_default=False,
)

if "" not in available_mechanisms:
available_mechanisms.append("")

assert isinstance(mechanism, str)
if mechanism:
mechanisms.append(mechanism)
available_mechanisms.remove(mechanism)
else:
cont = False

Expand Down

0 comments on commit 9deeec6

Please sign in to comment.