)]}'
{"nova/compute/api.py":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"93cfc44242920f92e44fd82dd43cfe4aa7d6f4ad","unresolved":true,"context_lines":[{"line_number":3987,"context_line":"        \"\"\""},{"line_number":3988,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3989,"context_line":"                context, instance.uuid)"},{"line_number":3990,"context_line":"        for vol in bdms:"},{"line_number":3991,"context_line":"            # connection_info might not be set so default to an empty dict so"},{"line_number":3992,"context_line":"            # that it can be serialized to an empty JSON object."},{"line_number":3993,"context_line":"            try:"},{"line_number":3994,"context_line":"                connection_info \u003d jsonutils.loads(vol.connection_info)"},{"line_number":3995,"context_line":"            except TypeError:"},{"line_number":3996,"context_line":"                connection_info \u003d {}"},{"line_number":3997,"context_line":"            volume_id \u003d vol.volume_id"},{"line_number":3998,"context_line":"            if volume_id:"},{"line_number":3999,"context_line":"                encryption \u003d encryptors.get_encryption_metadata("},{"line_number":4000,"context_line":"                    context, self.volume_api, volume_id, connection_info)"},{"line_number":4001,"context_line":"                if encryption:"}],"source_content_type":"text/x-python","patch_set":3,"id":"af47de7e_bcc4afa6","line":3998,"range":{"start_line":3990,"start_character":0,"end_line":3998,"end_character":25},"updated":"2021-03-30 08:46:35.000000000","message":"nit - This should really be a method in the BlockDeviceMapping object but to keep this backportable we can quickly filter the volume BDMs out here with something like:\n\n    volumes \u003d [v for v in bdms if v.is_volume and v.connection_info]\n    for vol in volumes:\n        volume_id \u003d vol.volume_id\n        connection_info \u003d jsonutils.loads(vol.connection_info)","commit_id":"f362e53eac0b104cb299152a2d9e173fcad3a19a"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"b3ad998f9a96f2988bf6cb206d24dea16818bc81","unresolved":false,"context_lines":[{"line_number":3987,"context_line":"        \"\"\""},{"line_number":3988,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3989,"context_line":"                context, instance.uuid)"},{"line_number":3990,"context_line":"        for vol in bdms:"},{"line_number":3991,"context_line":"            # connection_info might not be set so default to an empty dict so"},{"line_number":3992,"context_line":"            # that it can be serialized to an empty JSON object."},{"line_number":3993,"context_line":"            try:"},{"line_number":3994,"context_line":"                connection_info \u003d jsonutils.loads(vol.connection_info)"},{"line_number":3995,"context_line":"            except TypeError:"},{"line_number":3996,"context_line":"                connection_info \u003d {}"},{"line_number":3997,"context_line":"            volume_id \u003d vol.volume_id"},{"line_number":3998,"context_line":"            if volume_id:"},{"line_number":3999,"context_line":"                encryption \u003d encryptors.get_encryption_metadata("},{"line_number":4000,"context_line":"                    context, self.volume_api, volume_id, connection_info)"},{"line_number":4001,"context_line":"                if encryption:"}],"source_content_type":"text/x-python","patch_set":3,"id":"b18da9ba_2b6b8f49","line":3998,"range":{"start_line":3990,"start_character":0,"end_line":3998,"end_character":25},"in_reply_to":"af47de7e_bcc4afa6","updated":"2021-03-30 09:07:09.000000000","message":"Ack","commit_id":"f362e53eac0b104cb299152a2d9e173fcad3a19a"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"93cfc44242920f92e44fd82dd43cfe4aa7d6f4ad","unresolved":true,"context_lines":[{"line_number":4003,"context_line":"                    try:"},{"line_number":4004,"context_line":"                        keymgr.get(context, encryption[\u0027encryption_key_id\u0027])"},{"line_number":4005,"context_line":"                    except castellan_exception.KeyManagerError:"},{"line_number":4006,"context_line":"                        raise exception.ResizeError("},{"line_number":4007,"context_line":"                            reason\u003d(\"Failed to fetch encryption key for \""},{"line_number":4008,"context_line":"                                    \"volume %s\" % volume_id))"},{"line_number":4009,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a4438bc_620ea5d3","line":4006,"range":{"start_line":4006,"start_character":40,"end_line":4006,"end_character":51},"updated":"2021-03-30 08:46:35.000000000","message":"This needs to be something generic for the decorator to be useful outside of resize.","commit_id":"f362e53eac0b104cb299152a2d9e173fcad3a19a"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"b3ad998f9a96f2988bf6cb206d24dea16818bc81","unresolved":true,"context_lines":[{"line_number":4003,"context_line":"                    try:"},{"line_number":4004,"context_line":"                        keymgr.get(context, encryption[\u0027encryption_key_id\u0027])"},{"line_number":4005,"context_line":"                    except castellan_exception.KeyManagerError:"},{"line_number":4006,"context_line":"                        raise exception.ResizeError("},{"line_number":4007,"context_line":"                            reason\u003d(\"Failed to fetch encryption key for \""},{"line_number":4008,"context_line":"                                    \"volume %s\" % volume_id))"},{"line_number":4009,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f2bea89_f04afcd1","line":4006,"range":{"start_line":4006,"start_character":40,"end_line":4006,"end_character":51},"in_reply_to":"5a4438bc_620ea5d3","updated":"2021-03-30 09:07:09.000000000","message":"Agreed. I was hoping you might propose something 😊\n\nAny ideas, or shall I create a new exception?","commit_id":"f362e53eac0b104cb299152a2d9e173fcad3a19a"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"a7368eb4d7117d2c7232c86c1c92c189b1a32064","unresolved":false,"context_lines":[{"line_number":4003,"context_line":"                    try:"},{"line_number":4004,"context_line":"                        keymgr.get(context, encryption[\u0027encryption_key_id\u0027])"},{"line_number":4005,"context_line":"                    except castellan_exception.KeyManagerError:"},{"line_number":4006,"context_line":"                        raise exception.ResizeError("},{"line_number":4007,"context_line":"                            reason\u003d(\"Failed to fetch encryption key for \""},{"line_number":4008,"context_line":"                                    \"volume %s\" % volume_id))"},{"line_number":4009,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"b740c69d_6744fb1e","line":4006,"range":{"start_line":4006,"start_character":40,"end_line":4006,"end_character":51},"in_reply_to":"5f2bea89_f04afcd1","updated":"2021-03-30 20:26:28.000000000","message":"We do have our own KeyManagerError that might work here:\n\nhttps://github.com/openstack/nova/blob/16074287c0c60aa5b0a02ba8d03bf78a184a95fb/nova/exception.py#L1568-L1569\n\nI wonder if we should also make this a little more generic to capture all exceptions raised by the .get() call?","commit_id":"f362e53eac0b104cb299152a2d9e173fcad3a19a"}]}
