cruise-control
cruise-control copied to clipboard
cruise-control-client should accept Python booleans when adding 'json' parameter
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')