)]}'
{"ironicclient/osc/v1/baremetal_portgroup.py":[{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"b4172fae29aaabc766a3513038da634ce2e80ad8","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                \u0027add\u0027, [\"standalone_ports_supported\u003dFalse\"]))"},{"line_number":380,"context_line":"        if parsed_args.mode:"},{"line_number":381,"context_line":"            properties.extend(utils.args_array_to_patch("},{"line_number":382,"context_line":"                \u0027add\u0027, [\"mode\u003d\\\"%s\\\"\" % parsed_args.mode]))"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"        if parsed_args.extra:"},{"line_number":385,"context_line":"            properties.extend(utils.args_array_to_patch("}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_cb47b4bc","line":382,"updated":"2018-01-25 00:50:11.000000000","message":"couldn\u0027t we just str() parsed_args.mode ?","commit_id":"677a4d82358ac453744716952f6227bd6534f352"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"19661c9594bb167b66f687df1d41e38ef10c95c4","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                \u0027add\u0027, [\"standalone_ports_supported\u003dFalse\"]))"},{"line_number":380,"context_line":"        if parsed_args.mode:"},{"line_number":381,"context_line":"            properties.extend(utils.args_array_to_patch("},{"line_number":382,"context_line":"                \u0027add\u0027, [\"mode\u003d\\\"%s\\\"\" % parsed_args.mode]))"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"        if parsed_args.extra:"},{"line_number":385,"context_line":"            properties.extend(utils.args_array_to_patch("}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_310d6a3e","line":382,"in_reply_to":"5f93b717_cb47b4bc","updated":"2018-01-25 03:12:40.000000000","message":"@Julia, no, that won\u0027t help.\n\nThe API request (in ironic-api) expects the value to be a string.\n\nThe utils.args_array_to_patch() call ends up calling split_and_deserialize() which is so smart that it detects that the string value is actually an integer and converts it to an integer [1]. After that, it is json-encoded and becomes the body of the request --still as an integer. And ironic-api expects mode to be a string, hence the error (which incidentally I don\u0027t think we are catching, but...) I was wondering if it would be easy to change at the server level to handle a string or integer, but for now I guess, we can merge this since who knows when/if we\u0027ll address it. And I think at the API level, it might make sense to assume that it is text.\n\nThis fix puts quotations around the value so that [1] sees it as a string, not an integer and doesn\u0027t try to convert it to an integer.\n\nMaybe some of this would be useful in the commit msg, but anyway, here it is :)\n\n[1] https://github.com/openstack/python-ironicclient/blob/8f0c442c2ea463ebb038f0cc3d54a9906fda741a/ironicclient/common/utils.py#L93","commit_id":"677a4d82358ac453744716952f6227bd6534f352"},{"author":{"_account_id":24828,"name":"Kaifeng Wang","email":"kaifeng.w@gmail.com","username":"wangkf"},"change_message_id":"e72ac9495e1456429c50e65427fc95bdc17ca142","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                \u0027add\u0027, [\"standalone_ports_supported\u003dFalse\"]))"},{"line_number":380,"context_line":"        if parsed_args.mode:"},{"line_number":381,"context_line":"            properties.extend(utils.args_array_to_patch("},{"line_number":382,"context_line":"                \u0027add\u0027, [\"mode\u003d\\\"%s\\\"\" % parsed_args.mode]))"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"        if parsed_args.extra:"},{"line_number":385,"context_line":"            properties.extend(utils.args_array_to_patch("}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_0e8fe9cc","line":382,"in_reply_to":"5f93b717_cb47b4bc","updated":"2018-01-25 02:26:17.000000000","message":"actually parsed_args.mode is a string here, even passing a numeric. argparse assume a string if type is not specified.\n\nThe conversion happens at utils.split_and_deserialize, looks like json.loads(\u00271\u0027) will return a int type.","commit_id":"677a4d82358ac453744716952f6227bd6534f352"}]}
