Skip to content

Split key:value options on the first colon so values can contain colons - #153

Open
syahra712 wants to merge 2 commits into
apache:mainfrom
syahra712:fix/kv-option-values-with-colons
Open

syahra712 wants to merge 2 commits into
apache:mainfrom
syahra712:fix/kv-option-values-with-colons

Conversation

@syahra712

Copy link
Copy Markdown
Contributor

kv_to_map splits each key:value pair with kv.split(":"), so any value that contains a colon crashes the command before it starts. It parses --workload-params, --telemetry-params, --plugin-params, --cluster-config-params and the CSV form of --client-options, so a URL, a password or a time of day all fail the same way:

$ solr-orbit run ... --workload-params "bulk_size:100,source:'http://mirror:8080/docs.json'"
ValueError: too many values to unpack (expected 2)

Keys never contain a colon, so the fix splits on the first colon only (kv.split(":", 1)). The rest of the value, quoting included, is handled as before.

Tested: added test_kv_to_map_value_contains_colon (a URL, an unquoted password and a time); it fails on main and passes with the fix. ruff check is clean and the full unit suite passes (1181 passed, 5 skipped).

This branch has not been deployed

No deployments
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.

2 participants