Skip to content

Patched resolve_secret_option API function to handle multiword arguments properly#913

Open
lbuhleie wants to merge 1 commit into
Checkmk:masterfrom
svalabs:bugfix/resolve_secret_option
Open

Patched resolve_secret_option API function to handle multiword arguments properly#913
lbuhleie wants to merge 1 commit into
Checkmk:masterfrom
svalabs:bugfix/resolve_secret_option

Conversation

@lbuhleie
Copy link
Copy Markdown
Contributor

@lbuhleie lbuhleie commented May 8, 2026

General information

I encountered this issue when testing the new cmk.password_store.v1_unstable API that has been introduced with Checkmk 2.5.

Bugreport

When using the parser_add_secret_option and resolve_secret_option functions from the new cmk.password_store.v1_unstable API with the OPTION_NAME variable consisting of at least two words, separated by a '-' (e.g. 'client-secret'), the resolve function would break and throw a TypeError Exception. This happens because argparser translates such arguments to be separated by a '_' ("--client-secret" translates to args.client_secret).

Proposed changes

I fixed this with this small one-liner that before anything else replaces "-" by "_" in the option_name variable. The change does not break any behaviour, only fixes this small issue.

@github-actions
Copy link
Copy Markdown

Thank you for your contribution. This pull request has been marked as stale as it has not passed the automated tests and there was no activity for the last 14 days.
Please take a look at the ‘Checks’ section for details on the test results and make the necessary changes.

This pull request will be closed due to inactivity after 60 days, if no action is taken.

@github-actions github-actions Bot added the Stale Scheduled for auto-close label May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stale Scheduled for auto-close

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant