Skip to content

Patched resolve_secret_option password_store API function to handle multiword arguments properly - #947

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

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

Conversation

@lbuhleie

Copy link
Copy Markdown
Contributor

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.

I already did a Pull Request for this (#913), but some Pipelines failed and I lost track of it. So this is attempt #2 for this.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants