)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"29d2903482690e3d3f85f398857b517c7786970f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Bugfix: Set the appropriate status code for ServiceUnavailable"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now this class inherit from Invalid, However，the code of invalid"},{"line_number":10,"context_line":"exception is BAD_REQUEST(400), the status code of ServiceUnavailable"},{"line_number":11,"context_line":"should be 503."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1fa4df85_57827c54","line":9,"range":{"start_line":9,"start_character":44,"end_line":9,"end_character":45},"updated":"2020-03-11 12:20:45.000000000","message":"nit: This should be a EN comma.","commit_id":"ad7e02ba3051a3bf8878b0c4e594e927bcb5d8fa"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"1c5511ac2f64724918e40db7ab42dab1af89227f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Bugfix: Set the appropriate status code for ServiceUnavailable"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now this class inherit from Invalid, However，the code of invalid"},{"line_number":10,"context_line":"exception is BAD_REQUEST(400), the status code of ServiceUnavailable"},{"line_number":11,"context_line":"should be 503."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1fa4df85_e4c0862d","line":9,"range":{"start_line":9,"start_character":44,"end_line":9,"end_character":45},"in_reply_to":"1fa4df85_57827c54","updated":"2020-03-12 02:32:51.000000000","message":"Done","commit_id":"ad7e02ba3051a3bf8878b0c4e594e927bcb5d8fa"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"aa640a15b672d45443f68b7cd44c9a4d82d130ae","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Bugfix: Set the appropriate status code for ServiceUnavailable"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now this class inherit from Invalid, However，the code of invalid"},{"line_number":10,"context_line":"exception is BAD_REQUEST(400), the status code of ServiceUnavailable"},{"line_number":11,"context_line":"should be 503."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1fa4df85_2490de4e","line":9,"range":{"start_line":9,"start_character":44,"end_line":9,"end_character":45},"in_reply_to":"1fa4df85_57827c54","updated":"2020-03-12 02:31:31.000000000","message":"ok.","commit_id":"ad7e02ba3051a3bf8878b0c4e594e927bcb5d8fa"}],"cyborg/common/exception.py":[{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"29d2903482690e3d3f85f398857b517c7786970f","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    _msg_fmt \u003d _(\"DeviceProfile with uuid %(uuid)s already exists.\")"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"class DeviceProfileNameNeeded(CyborgException):"},{"line_number":127,"context_line":"    _msg_fmt \u003d _(\"DeviceProfile name needed.\")"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_cc0b4329","line":126,"range":{"start_line":126,"start_character":6,"end_line":126,"end_character":29},"updated":"2020-03-11 12:20:45.000000000","message":"[1][2] Looks like this is should be BAD_REQUEST (code 400).\n[3] Maybe we will never catch this exception, right? Because when creating a device profile, it is not allowed without \u0027name\u0027 as [2].\n\n[1]https://opendev.org/openstack/cyborg/src/branch/master/cyborg/api/controllers/v2/arqs.py#L137\n[2]https://opendev.org/openstack/cyborg/src/branch/master/cyborg/api/controllers/v2/device_profiles.py#L132","commit_id":"ad7e02ba3051a3bf8878b0c4e594e927bcb5d8fa"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"6b0de580d46875e661478eca75fdcfa48de25a8f","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    _msg_fmt \u003d _(\"DeviceProfile with uuid %(uuid)s already exists.\")"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"class DeviceProfileNameNeeded(CyborgException):"},{"line_number":127,"context_line":"    _msg_fmt \u003d _(\"DeviceProfile name needed.\")"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_c6353baa","line":126,"range":{"start_line":126,"start_character":6,"end_line":126,"end_character":29},"in_reply_to":"1fa4df85_84b672dc","updated":"2020-03-13 07:34:11.000000000","message":"[1][2] all in api, that can be raised to user, so I think it should a BadRequest.\n\n[3] I\u0027m not sure if we will necessarily trigger this exception.","commit_id":"ad7e02ba3051a3bf8878b0c4e594e927bcb5d8fa"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"aa640a15b672d45443f68b7cd44c9a4d82d130ae","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    _msg_fmt \u003d _(\"DeviceProfile with uuid %(uuid)s already exists.\")"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"class DeviceProfileNameNeeded(CyborgException):"},{"line_number":127,"context_line":"    _msg_fmt \u003d _(\"DeviceProfile name needed.\")"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_84b672dc","line":126,"range":{"start_line":126,"start_character":6,"end_line":126,"end_character":29},"in_reply_to":"1fa4df85_cc0b4329","updated":"2020-03-12 02:31:31.000000000","message":"I think [1][2][3] need to judge ,maybe user create db directly. One more judgment in arq and extarq can make the program more secure.\nAbout the code 400 or 500,I think can be recheck later.","commit_id":"ad7e02ba3051a3bf8878b0c4e594e927bcb5d8fa"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"ab643893419cd396a0262a4c72fde6441c9e3106","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    _msg_fmt \u003d _(\"DeviceProfile with uuid %(uuid)s already exists.\")"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"class DeviceProfileNameNeeded(CyborgException):"},{"line_number":127,"context_line":"    _msg_fmt \u003d _(\"DeviceProfile name needed.\")"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_57e7dc47","line":126,"range":{"start_line":126,"start_character":6,"end_line":126,"end_character":29},"in_reply_to":"1fa4df85_cc0b4329","updated":"2020-03-11 12:22:03.000000000","message":"[3]https://opendev.org/openstack/cyborg/src/branch/master/cyborg/db/sqlalchemy/api.py#L837","commit_id":"ad7e02ba3051a3bf8878b0c4e594e927bcb5d8fa"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"6b0de580d46875e661478eca75fdcfa48de25a8f","unresolved":false,"context_lines":[{"line_number":206,"context_line":""},{"line_number":207,"context_line":"class ServiceUnavailable(CyborgException):"},{"line_number":208,"context_line":"    _msg_fmt \u003d _(\"Service is unavailable at this time.\")"},{"line_number":209,"context_line":"    code \u003d http_client.SERVICE_UNAVAILABLE"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"class ServiceNotFound(NotFound):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_860d03ea","line":209,"updated":"2020-03-13 07:34:11.000000000","message":"Can you add a test case for this change? \nI think you can check the get_sdk_adapter() [1], we should make sure that future changes will not change here.\n\n[1]https://opendev.org/openstack/cyborg/src/branch/master/cyborg/common/utils.py#L135","commit_id":"ad7e02ba3051a3bf8878b0c4e594e927bcb5d8fa"}]}
