Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cruise-control-client should accept Python booleans when adding 'json' parameter #872

Open
mgrubent opened this issue Jul 30, 2019 · 0 comments
Labels
correctness A condition affecting the proper functionality.

Comments

@mgrubent
Copy link
Contributor

Background

cruise-control-client allows for users to specify the parameter=value pairs for the endpoint.

For parameters that cruise-control-client has implemented (like json, under JSONParameter), cruise-control-client performs additional verification to ensure that common invalid values are not passed to this parameter.

A valid way to add the json=True pairing should be

endpoint.add_param(parameter_name="json", value=True)

Issue

cruise-control-client falsely invalidates the above, with

    raise ValueError("url must contain the \"json=true\" parameter")

This failure also exists when using an uppercased string rather than a boolean

endpoint.add_param(parameter_name="json", value='True')

Both of the above are incorrect failures, and should be fixed.

A workaround in the meantime is to use a lowercased string

endpoint.add_param(parameter_name="json", value='true')
@efeg efeg added the correctness A condition affecting the proper functionality. label Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
correctness A condition affecting the proper functionality.
Projects
None yet
Development

No branches or pull requests

2 participants