Hide Forgot
Description of problem: You are able to add rate to any chargeback (non-existent) via REST API what could cause the unexpected error in UI. Version-Release number of selected component (if applicable): 5.6.0.1 How reproducible: 100% Steps to Reproduce: 1. Add rate via REST API with argument chargeback_rate_id = 25658956 chargeback_rate_id corresponds to non-existent id Actual results: The Rate is added successfully. Expected results: Error message about incorrect chargeback should be returned
PR: https://github.com/ManageIQ/manageiq/pull/8262
This was fixed in 5.6.0.5. Please move to CLOSED CURRENTRELEASE if verification passes.
Verified that it is no longer possible to create rate with non-existent chargeback_rate_id. Request with non-existent chargeback_rate_id: POST /api/rates {"per_time": "daily", "chargeback_rate_id": 22222, "description": "test_rate_0_GWzpMP5qsYZ", "group": "cpu", "per_unit": "megahertz", "source": "allocated"} Response: { "error": { "kind": "bad_request", "message": "Chargeback rate can't be blank", "klass": "ApiController::BadRequestError" } } Request with existing chargeback_rate_id: POST /api/rates {"per_time": "daily", "chargeback_rate_id": 1, "description": "test_rate_0_GWzpMP5qsYZ", "group": "cpu", "per_unit": "megahertz", "source": "allocated"} Response: { "results": [ { "id": 15, "enabled": true, "description": "test_rate_0_GWzpMP5qsYZ", "group": "cpu", "source": "allocated", "per_time": "daily", "per_unit": "megahertz", "friendly_rate": "", "chargeback_rate_id": 2, "created_on": "2016-10-18T12:30:31Z", "updated_on": "2016-10-18T12:30:31Z" } ] }