Skip to content

Patched resolve_secret_option API function to handle multiword arguments properly#913

Open
lbuhleie wants to merge 1 commit intoCheckmk: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 intoCheckmk: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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant