)]}'
{"nova/compute/api.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"919462bc11b1b89230c3d7d92e6150dc586e48a9","unresolved":false,"context_lines":[{"line_number":5070,"context_line":"        try:"},{"line_number":5071,"context_line":"            cell_mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":5072,"context_line":"                context, instance.uuid).cell_mapping"},{"line_number":5073,"context_line":"        except exception.InstanceMappingNotFound:"},{"line_number":5074,"context_line":"            raise exception.MigrationPreCheckError("},{"line_number":5075,"context_line":"                reason\u003d(_(\u0027Unable to determine in which cell \u0027"},{"line_number":5076,"context_line":"                          \u0027instance %s lives.\u0027) % instance.uuid))"},{"line_number":5077,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_86c43d94","line":5074,"range":{"start_line":5073,"start_character":0,"end_line":5074,"end_character":51},"updated":"2020-07-03 09:09:25.000000000","message":"I\u0027m wondering what should we return to the API use when we hit this. As far as I see the API code does not handle the InstanceMappingNotFound or the MigrationPreCheckError either[1]. So I think this will become HTTP 500 now.\n\n\n\n[1] https://github.com/openstack/nova/blob/43802e5170595ce20cee73517e1e4d7c81fef079/nova/api/openstack/compute/evacuate.py#L140-L148","commit_id":"65dd754cb7f92ed0499145a3303c6650fa648cba"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"61920ad4e38d526358fc5576045e6cf8d79a5e8e","unresolved":false,"context_lines":[{"line_number":5070,"context_line":"        try:"},{"line_number":5071,"context_line":"            cell_mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":5072,"context_line":"                context, instance.uuid).cell_mapping"},{"line_number":5073,"context_line":"        except exception.InstanceMappingNotFound:"},{"line_number":5074,"context_line":"            raise exception.MigrationPreCheckError("},{"line_number":5075,"context_line":"                reason\u003d(_(\u0027Unable to determine in which cell \u0027"},{"line_number":5076,"context_line":"                          \u0027instance %s lives.\u0027) % instance.uuid))"},{"line_number":5077,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_f92dac46","line":5074,"range":{"start_line":5073,"start_character":0,"end_line":5074,"end_character":51},"in_reply_to":"bf51134e_4bb965e7","updated":"2020-07-07 16:11:31.000000000","message":"we can return 404 from API if mapping not found. That is how we return in server or tag API- \n\nhttps://github.com/openstack/nova/blob/6f6b63ee5f7ae180d5f81e61f04332f7aa14f9be/nova/api/openstack/compute/servers.py#L1296\n\ninstead of checking cell mapping here, I will suggest we do in API controller and pass the cell_mapping in this method. That will be consistent with other server actions.\n- https://github.com/openstack/nova/blob/6f6b63ee5f7ae180d5f81e61f04332f7aa14f9be/nova/api/openstack/compute/evacuate.py#L88","commit_id":"65dd754cb7f92ed0499145a3303c6650fa648cba"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"401857bb827495f0bfbbbf9fd7b1f0b76c319d5f","unresolved":false,"context_lines":[{"line_number":5070,"context_line":"        try:"},{"line_number":5071,"context_line":"            cell_mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":5072,"context_line":"                context, instance.uuid).cell_mapping"},{"line_number":5073,"context_line":"        except exception.InstanceMappingNotFound:"},{"line_number":5074,"context_line":"            raise exception.MigrationPreCheckError("},{"line_number":5075,"context_line":"                reason\u003d(_(\u0027Unable to determine in which cell \u0027"},{"line_number":5076,"context_line":"                          \u0027instance %s lives.\u0027) % instance.uuid))"},{"line_number":5077,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_4bb965e7","line":5074,"range":{"start_line":5073,"start_character":0,"end_line":5074,"end_character":51},"in_reply_to":"bf51134e_86c43d94","updated":"2020-07-07 13:03:22.000000000","message":"If we can\u0027t get the InstanceMapping record from this instance, then it would be a super huge problem as this instance wouldn\u0027t be seen by the API.\n\nSo, I\u0027d like to see the instance status to become ERROR if the evacuate call goes there, but not by just having an exception like this.\nSo, yeah, please provide a new exception and add it in the compute API so the operator would better understand the issue.","commit_id":"65dd754cb7f92ed0499145a3303c6650fa648cba"}]}
