)]}'
{"cinder/backup/manager.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"42753f6028ba5c1ef35ef67f5fa22dc15432cc33","unresolved":true,"context_lines":[{"line_number":379,"context_line":"                }"},{"line_number":380,"context_line":"                volume_utils.update_backup_error(backup, err)"},{"line_number":381,"context_line":"                raise exception.InvalidVolume(reason\u003derr)"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"        expected_status \u003d fields.BackupStatus.CREATING"},{"line_number":384,"context_line":"        actual_status \u003d backup.status"},{"line_number":385,"context_line":"        if actual_status !\u003d expected_status:"},{"line_number":386,"context_line":"            err \u003d _(\u0027Create backup aborted, expected backup status \u0027"},{"line_number":387,"context_line":"                    \u0027%(expected_status)s but got %(actual_status)s.\u0027) % {"},{"line_number":388,"context_line":"                \u0027expected_status\u0027: expected_status,"},{"line_number":389,"context_line":"                \u0027actual_status\u0027: actual_status,"},{"line_number":390,"context_line":"            }"},{"line_number":391,"context_line":"            volume_utils.update_backup_error(backup, err)"},{"line_number":392,"context_line":"            raise exception.InvalidBackup(reason\u003derr)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        try:"},{"line_number":395,"context_line":"            if not self.is_working():"}],"source_content_type":"text/x-python","patch_set":6,"id":"f2fb992a_8baecc3e","line":392,"range":{"start_line":382,"start_character":0,"end_line":392,"end_character":53},"updated":"2021-06-01 18:30:30.000000000","message":"-1: Why aren\u0027t we creating a user message here?","commit_id":"dfb6575121d1445bb7523e93ea5a414f76a5786c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33de2e6fcd161d8353e29fcc909944f3ea7df560","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                }"},{"line_number":380,"context_line":"                volume_utils.update_backup_error(backup, err)"},{"line_number":381,"context_line":"                raise exception.InvalidVolume(reason\u003derr)"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"        expected_status \u003d fields.BackupStatus.CREATING"},{"line_number":384,"context_line":"        actual_status \u003d backup.status"},{"line_number":385,"context_line":"        if actual_status !\u003d expected_status:"},{"line_number":386,"context_line":"            err \u003d _(\u0027Create backup aborted, expected backup status \u0027"},{"line_number":387,"context_line":"                    \u0027%(expected_status)s but got %(actual_status)s.\u0027) % {"},{"line_number":388,"context_line":"                \u0027expected_status\u0027: expected_status,"},{"line_number":389,"context_line":"                \u0027actual_status\u0027: actual_status,"},{"line_number":390,"context_line":"            }"},{"line_number":391,"context_line":"            volume_utils.update_backup_error(backup, err)"},{"line_number":392,"context_line":"            raise exception.InvalidBackup(reason\u003derr)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        try:"},{"line_number":395,"context_line":"            if not self.is_working():"}],"source_content_type":"text/x-python","patch_set":6,"id":"d4b24aab_bc9c36f6","line":392,"range":{"start_line":382,"start_character":0,"end_line":392,"end_character":53},"in_reply_to":"f2fb992a_8baecc3e","updated":"2021-06-08 03:24:58.000000000","message":"Done","commit_id":"dfb6575121d1445bb7523e93ea5a414f76a5786c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"42753f6028ba5c1ef35ef67f5fa22dc15432cc33","unresolved":true,"context_lines":[{"line_number":392,"context_line":"            raise exception.InvalidBackup(reason\u003derr)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        try:"},{"line_number":395,"context_line":"            if not self.is_working():"},{"line_number":396,"context_line":"                err \u003d _(\u0027Create backup aborted due to backup service is down.\u0027)"},{"line_number":397,"context_line":"                volume_utils.update_backup_error(backup, err)"},{"line_number":398,"context_line":"                raise exception.InvalidBackup(reason\u003derr)"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"            backup.service \u003d self.driver_name"},{"line_number":401,"context_line":"            backup.save()"}],"source_content_type":"text/x-python","patch_set":6,"id":"deae7a4e_1b2859f8","line":398,"range":{"start_line":395,"start_character":0,"end_line":398,"end_character":57},"updated":"2021-06-01 18:30:30.000000000","message":"-1: And here?","commit_id":"dfb6575121d1445bb7523e93ea5a414f76a5786c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33de2e6fcd161d8353e29fcc909944f3ea7df560","unresolved":false,"context_lines":[{"line_number":392,"context_line":"            raise exception.InvalidBackup(reason\u003derr)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        try:"},{"line_number":395,"context_line":"            if not self.is_working():"},{"line_number":396,"context_line":"                err \u003d _(\u0027Create backup aborted due to backup service is down.\u0027)"},{"line_number":397,"context_line":"                volume_utils.update_backup_error(backup, err)"},{"line_number":398,"context_line":"                raise exception.InvalidBackup(reason\u003derr)"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"            backup.service \u003d self.driver_name"},{"line_number":401,"context_line":"            backup.save()"}],"source_content_type":"text/x-python","patch_set":6,"id":"a0295f84_f46d6969","line":398,"range":{"start_line":395,"start_character":0,"end_line":398,"end_character":57},"in_reply_to":"deae7a4e_1b2859f8","updated":"2021-06-08 03:24:58.000000000","message":"Done","commit_id":"dfb6575121d1445bb7523e93ea5a414f76a5786c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"42753f6028ba5c1ef35ef67f5fa22dc15432cc33","unresolved":true,"context_lines":[{"line_number":402,"context_line":"            updates \u003d self._run_backup(context, backup, volume)"},{"line_number":403,"context_line":"        except Exception as err:"},{"line_number":404,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":405,"context_line":"                self.message_api.create("},{"line_number":406,"context_line":"                    context,"},{"line_number":407,"context_line":"                    action\u003dmessage_field.Action.BACKUP_CREATE,"},{"line_number":408,"context_line":"                    resource_type\u003dmessage_field.Resource.VOLUME_BACKUP,"},{"line_number":409,"context_line":"                    resource_uuid\u003dbackup.id,"},{"line_number":410,"context_line":"                    exception\u003derr,"},{"line_number":411,"context_line":"                    detail\u003dmessage_field.Detail.BACKUP_CREATE_ERROR)"},{"line_number":412,"context_line":"                if snapshot_id:"},{"line_number":413,"context_line":"                    snapshot.status \u003d fields.SnapshotStatus.AVAILABLE"},{"line_number":414,"context_line":"                    snapshot.save()"}],"source_content_type":"text/x-python","patch_set":6,"id":"f88c15bd_c6ab459a","line":411,"range":{"start_line":405,"start_character":0,"end_line":411,"end_character":68},"updated":"2021-06-01 18:30:30.000000000","message":"We should move this to the last action in the exception, because if it raises an exception it will prevent the DB updates for the resources.","commit_id":"dfb6575121d1445bb7523e93ea5a414f76a5786c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33de2e6fcd161d8353e29fcc909944f3ea7df560","unresolved":false,"context_lines":[{"line_number":402,"context_line":"            updates \u003d self._run_backup(context, backup, volume)"},{"line_number":403,"context_line":"        except Exception as err:"},{"line_number":404,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":405,"context_line":"                self.message_api.create("},{"line_number":406,"context_line":"                    context,"},{"line_number":407,"context_line":"                    action\u003dmessage_field.Action.BACKUP_CREATE,"},{"line_number":408,"context_line":"                    resource_type\u003dmessage_field.Resource.VOLUME_BACKUP,"},{"line_number":409,"context_line":"                    resource_uuid\u003dbackup.id,"},{"line_number":410,"context_line":"                    exception\u003derr,"},{"line_number":411,"context_line":"                    detail\u003dmessage_field.Detail.BACKUP_CREATE_ERROR)"},{"line_number":412,"context_line":"                if snapshot_id:"},{"line_number":413,"context_line":"                    snapshot.status \u003d fields.SnapshotStatus.AVAILABLE"},{"line_number":414,"context_line":"                    snapshot.save()"}],"source_content_type":"text/x-python","patch_set":6,"id":"91ac600d_9bf028c7","line":411,"range":{"start_line":405,"start_character":0,"end_line":411,"end_character":68},"in_reply_to":"f88c15bd_c6ab459a","updated":"2021-06-08 03:24:58.000000000","message":"Done","commit_id":"dfb6575121d1445bb7523e93ea5a414f76a5786c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"de2fa829904f78899bb5965c800dabe8091281dd","unresolved":true,"context_lines":[{"line_number":394,"context_line":"                action\u003dmessage_field.Action.BACKUP_CREATE,"},{"line_number":395,"context_line":"                resource_type\u003dmessage_field.Resource.VOLUME_BACKUP,"},{"line_number":396,"context_line":"                resource_uuid\u003dbackup.id,"},{"line_number":397,"context_line":"                exception\u003dexception.InvalidBackup(reason\u003derr),"},{"line_number":398,"context_line":"                detail\u003dmessage_field.Detail.BACKUP_INVALID_STATE)"},{"line_number":399,"context_line":"            raise exception.InvalidBackup(reason\u003derr)"},{"line_number":400,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9259f767_007a05d6","line":397,"range":{"start_line":397,"start_character":26,"end_line":397,"end_character":62},"updated":"2021-06-07 13:14:07.000000000","message":"nit: We are instantiating the exception twice (here and on L398) should we just store it in a variable instead?\n(this happens in the other messages as well)","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33de2e6fcd161d8353e29fcc909944f3ea7df560","unresolved":true,"context_lines":[{"line_number":394,"context_line":"                action\u003dmessage_field.Action.BACKUP_CREATE,"},{"line_number":395,"context_line":"                resource_type\u003dmessage_field.Resource.VOLUME_BACKUP,"},{"line_number":396,"context_line":"                resource_uuid\u003dbackup.id,"},{"line_number":397,"context_line":"                exception\u003dexception.InvalidBackup(reason\u003derr),"},{"line_number":398,"context_line":"                detail\u003dmessage_field.Detail.BACKUP_INVALID_STATE)"},{"line_number":399,"context_line":"            raise exception.InvalidBackup(reason\u003derr)"},{"line_number":400,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"c648bd77_93b6b6a1","line":397,"range":{"start_line":397,"start_character":26,"end_line":397,"end_character":62},"in_reply_to":"9259f767_007a05d6","updated":"2021-06-08 03:24:58.000000000","message":"Yes, i realized it while writing tests. will update in next PS, thanks!","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"e927ab95cceebab81327701e9a7fc4bd590ae963","unresolved":false,"context_lines":[{"line_number":394,"context_line":"                action\u003dmessage_field.Action.BACKUP_CREATE,"},{"line_number":395,"context_line":"                resource_type\u003dmessage_field.Resource.VOLUME_BACKUP,"},{"line_number":396,"context_line":"                resource_uuid\u003dbackup.id,"},{"line_number":397,"context_line":"                exception\u003dexception.InvalidBackup(reason\u003derr),"},{"line_number":398,"context_line":"                detail\u003dmessage_field.Detail.BACKUP_INVALID_STATE)"},{"line_number":399,"context_line":"            raise exception.InvalidBackup(reason\u003derr)"},{"line_number":400,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"a095fed1_56d22a55","line":397,"range":{"start_line":397,"start_character":26,"end_line":397,"end_character":62},"in_reply_to":"c648bd77_93b6b6a1","updated":"2021-06-08 11:05:29.000000000","message":"Done","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"de2fa829904f78899bb5965c800dabe8091281dd","unresolved":true,"context_lines":[{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    def _run_backup(self, context, backup, volume):"},{"line_number":464,"context_line":"        # Save a copy of the encryption key ID in case the volume is deleted."},{"line_number":465,"context_line":"        message_created \u003d False"},{"line_number":466,"context_line":"        if (volume.encryption_key_id is not None and"},{"line_number":467,"context_line":"                backup.encryption_key_id is None):"},{"line_number":468,"context_line":"            backup.encryption_key_id \u003d volume_utils.clone_encryption_key("}],"source_content_type":"text/x-python","patch_set":7,"id":"3c40ad18_0d4232dc","line":465,"range":{"start_line":465,"start_character":8,"end_line":465,"end_character":31},"updated":"2021-06-07 13:14:07.000000000","message":"nice way of not logging adding unnecessary messages!","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"e927ab95cceebab81327701e9a7fc4bd590ae963","unresolved":false,"context_lines":[{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    def _run_backup(self, context, backup, volume):"},{"line_number":464,"context_line":"        # Save a copy of the encryption key ID in case the volume is deleted."},{"line_number":465,"context_line":"        message_created \u003d False"},{"line_number":466,"context_line":"        if (volume.encryption_key_id is not None and"},{"line_number":467,"context_line":"                backup.encryption_key_id is None):"},{"line_number":468,"context_line":"            backup.encryption_key_id \u003d volume_utils.clone_encryption_key("}],"source_content_type":"text/x-python","patch_set":7,"id":"57e8569d_404f61f5","line":465,"range":{"start_line":465,"start_character":8,"end_line":465,"end_character":31},"in_reply_to":"3c40ad18_0d4232dc","updated":"2021-06-08 11:05:29.000000000","message":"Done","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"de2fa829904f78899bb5965c800dabe8091281dd","unresolved":true,"context_lines":[{"line_number":485,"context_line":"                                                                     volume)"},{"line_number":486,"context_line":"            except Exception as ex:"},{"line_number":487,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":488,"context_line":"                    message_created \u003d True"},{"line_number":489,"context_line":"                    self.message_api.create("},{"line_number":490,"context_line":"                        context,"},{"line_number":491,"context_line":"                        action\u003dmessage_field.Action.BACKUP_CREATE,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fbafa152_7d574491","line":488,"range":{"start_line":488,"start_character":20,"end_line":488,"end_character":42},"updated":"2021-06-07 13:14:07.000000000","message":"nit: This should be set after we actually create the message.  Or are you doing it here because you prefer that a transient DB error here doesn\u0027t make us log it as a broader message below?","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"806af9aaa798a5f33f982a8bb14bba756a529790","unresolved":false,"context_lines":[{"line_number":485,"context_line":"                                                                     volume)"},{"line_number":486,"context_line":"            except Exception as ex:"},{"line_number":487,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":488,"context_line":"                    message_created \u003d True"},{"line_number":489,"context_line":"                    self.message_api.create("},{"line_number":490,"context_line":"                        context,"},{"line_number":491,"context_line":"                        action\u003dmessage_field.Action.BACKUP_CREATE,"}],"source_content_type":"text/x-python","patch_set":7,"id":"6dd79682_f7657cd2","line":488,"range":{"start_line":488,"start_character":20,"end_line":488,"end_character":42},"in_reply_to":"8de4a415_67a5febd","updated":"2021-06-14 08:10:28.000000000","message":"Done","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"e927ab95cceebab81327701e9a7fc4bd590ae963","unresolved":true,"context_lines":[{"line_number":485,"context_line":"                                                                     volume)"},{"line_number":486,"context_line":"            except Exception as ex:"},{"line_number":487,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":488,"context_line":"                    message_created \u003d True"},{"line_number":489,"context_line":"                    self.message_api.create("},{"line_number":490,"context_line":"                        context,"},{"line_number":491,"context_line":"                        action\u003dmessage_field.Action.BACKUP_CREATE,"}],"source_content_type":"text/x-python","patch_set":7,"id":"8de4a415_67a5febd","line":488,"range":{"start_line":488,"start_character":20,"end_line":488,"end_character":42},"in_reply_to":"ddbf2bd0_24500423","updated":"2021-06-08 11:05:29.000000000","message":"I find that a good approach, and in that case then you should keep it like it was, but maybe add a comment that explains why, stating that we prefer to be missing a user message than writing a misleading one.","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33de2e6fcd161d8353e29fcc909944f3ea7df560","unresolved":true,"context_lines":[{"line_number":485,"context_line":"                                                                     volume)"},{"line_number":486,"context_line":"            except Exception as ex:"},{"line_number":487,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":488,"context_line":"                    message_created \u003d True"},{"line_number":489,"context_line":"                    self.message_api.create("},{"line_number":490,"context_line":"                        context,"},{"line_number":491,"context_line":"                        action\u003dmessage_field.Action.BACKUP_CREATE,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ddbf2bd0_24500423","line":488,"range":{"start_line":488,"start_character":20,"end_line":488,"end_character":42},"in_reply_to":"fbafa152_7d574491","updated":"2021-06-08 03:24:58.000000000","message":"My idea was if the message create fails then we don\u0027t create a wrong message by catching base Exception class but i assume if this message create fails then other one will possibly too so will move it after creating the message.","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"de2fa829904f78899bb5965c800dabe8091281dd","unresolved":true,"context_lines":[{"line_number":524,"context_line":"        except Exception as ex:"},{"line_number":525,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":526,"context_line":"                if not message_created:"},{"line_number":527,"context_line":"                    message_created \u003d True"},{"line_number":528,"context_line":"                    self.message_api.create("},{"line_number":529,"context_line":"                        context,"},{"line_number":530,"context_line":"                        action\u003dmessage_field.Action.BACKUP_CREATE,"}],"source_content_type":"text/x-python","patch_set":7,"id":"87168e3d_b362be8f","line":527,"updated":"2021-06-07 13:14:07.000000000","message":"ditto","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33de2e6fcd161d8353e29fcc909944f3ea7df560","unresolved":false,"context_lines":[{"line_number":524,"context_line":"        except Exception as ex:"},{"line_number":525,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":526,"context_line":"                if not message_created:"},{"line_number":527,"context_line":"                    message_created \u003d True"},{"line_number":528,"context_line":"                    self.message_api.create("},{"line_number":529,"context_line":"                        context,"},{"line_number":530,"context_line":"                        action\u003dmessage_field.Action.BACKUP_CREATE,"}],"source_content_type":"text/x-python","patch_set":7,"id":"afe16a5e_46cbf64b","line":527,"in_reply_to":"87168e3d_b362be8f","updated":"2021-06-08 03:24:58.000000000","message":"Done","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"de2fa829904f78899bb5965c800dabe8091281dd","unresolved":true,"context_lines":[{"line_number":532,"context_line":"                        resource_uuid\u003dbackup.id,"},{"line_number":533,"context_line":"                        exception\u003dex,"},{"line_number":534,"context_line":"                        detail\u003d"},{"line_number":535,"context_line":"                        message_field.Detail.BACKUP_CREATE_ATTACH_DETACH_ERROR)"},{"line_number":536,"context_line":"        finally:"},{"line_number":537,"context_line":"            with backup.as_read_deleted():"},{"line_number":538,"context_line":"                backup.refresh()"}],"source_content_type":"text/x-python","patch_set":7,"id":"38807b2b_79491ba1","line":535,"updated":"2021-06-07 13:14:07.000000000","message":"?: Should be differentiate between the attach/detach and the upload of the backup part?","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33de2e6fcd161d8353e29fcc909944f3ea7df560","unresolved":true,"context_lines":[{"line_number":532,"context_line":"                        resource_uuid\u003dbackup.id,"},{"line_number":533,"context_line":"                        exception\u003dex,"},{"line_number":534,"context_line":"                        detail\u003d"},{"line_number":535,"context_line":"                        message_field.Detail.BACKUP_CREATE_ATTACH_DETACH_ERROR)"},{"line_number":536,"context_line":"        finally:"},{"line_number":537,"context_line":"            with backup.as_read_deleted():"},{"line_number":538,"context_line":"                backup.refresh()"}],"source_content_type":"text/x-python","patch_set":7,"id":"6ce290a3_89649547","line":535,"in_reply_to":"38807b2b_79491ba1","updated":"2021-06-08 03:24:58.000000000","message":"The only possible way i could think of is to use try/catch with every method and it didn\u0027t look good to me for code readability, i will update it but let me know if there\u0027s any better solution to it.","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"e927ab95cceebab81327701e9a7fc4bd590ae963","unresolved":true,"context_lines":[{"line_number":532,"context_line":"                        resource_uuid\u003dbackup.id,"},{"line_number":533,"context_line":"                        exception\u003dex,"},{"line_number":534,"context_line":"                        detail\u003d"},{"line_number":535,"context_line":"                        message_field.Detail.BACKUP_CREATE_ATTACH_DETACH_ERROR)"},{"line_number":536,"context_line":"        finally:"},{"line_number":537,"context_line":"            with backup.as_read_deleted():"},{"line_number":538,"context_line":"                backup.refresh()"}],"source_content_type":"text/x-python","patch_set":7,"id":"972e9f12_e1ce8cbc","line":535,"in_reply_to":"6ce290a3_89649547","updated":"2021-06-08 11:05:29.000000000","message":"Sometimes we need to look at the bigger picture and provide some basic infrastructure code that will help other patches.\n\nIn this case we could look into expanding the `RequestContext` class to be able to have the action and the resource_type so that code deeper in the call chain can use it regardless of who is making the code.\n\nProbably best if I give an example:\n\n- We add `request_action` and `request_resource_type` fields to RequestContext and initialize them both to None.\n- We add to cinder.messages.api.API a method called `create_from_context` (or some better name) that unlike the `create` method doesn\u0027t have a default for `action` or `resource_type` and uses the values available in the context, and if the context doesn\u0027t have the info then it doesn\u0027t create the message.\n- Maybe we even create a decorator in cinder.messages to add the right values to `request_action` and `request_resource_type` in the `context`, or we do it at the beginning of the method.  We could go as far as adding the `id` of the resource to the context as well.\n- Then for example in the `_connect_device` method we catch exceptions and call the new `create_from_context` method of the message API (we need to pass the context there).\n\nThis pattern would be useful for the attach/detach in the volume manager and will reduce the number of parameters we need to pass to create messages, since those 2 parameters will be in the context.\n\nThinking about this a bit more, I think we should discuss in tomorrow\u0027s IRC meeting what\u0027s the level of user messages we want to log, because maybe logging that what failed is the attach is too much information and your approach of less detailed error is better.","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"806af9aaa798a5f33f982a8bb14bba756a529790","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                        resource_uuid\u003dbackup.id,"},{"line_number":533,"context_line":"                        exception\u003dex,"},{"line_number":534,"context_line":"                        detail\u003d"},{"line_number":535,"context_line":"                        message_field.Detail.BACKUP_CREATE_ATTACH_DETACH_ERROR)"},{"line_number":536,"context_line":"        finally:"},{"line_number":537,"context_line":"            with backup.as_read_deleted():"},{"line_number":538,"context_line":"                backup.refresh()"}],"source_content_type":"text/x-python","patch_set":7,"id":"eb78652e_48ef2547","line":535,"in_reply_to":"972e9f12_e1ce8cbc","updated":"2021-06-14 08:10:28.000000000","message":"Done","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"de2fa829904f78899bb5965c800dabe8091281dd","unresolved":true,"context_lines":[{"line_number":601,"context_line":"                 (fields.VolumeStatus.ERROR if"},{"line_number":602,"context_line":"                  volume_previous_status \u003d\u003d fields.VolumeStatus.CREATING else"},{"line_number":603,"context_line":"                  fields.VolumeStatus.ERROR_RESTORING)})"},{"line_number":604,"context_line":"            raise exception.InvalidVolume(reason\u003derr)"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"        expected_status \u003d fields.BackupStatus.RESTORING"},{"line_number":607,"context_line":"        actual_status \u003d backup[\u0027status\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"6cdc31ee_092fe08f","line":604,"updated":"2021-06-07 13:14:07.000000000","message":"?: We should create a message here as well, like we did on L392, right?","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33de2e6fcd161d8353e29fcc909944f3ea7df560","unresolved":true,"context_lines":[{"line_number":601,"context_line":"                 (fields.VolumeStatus.ERROR if"},{"line_number":602,"context_line":"                  volume_previous_status \u003d\u003d fields.VolumeStatus.CREATING else"},{"line_number":603,"context_line":"                  fields.VolumeStatus.ERROR_RESTORING)})"},{"line_number":604,"context_line":"            raise exception.InvalidVolume(reason\u003derr)"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"        expected_status \u003d fields.BackupStatus.RESTORING"},{"line_number":607,"context_line":"        actual_status \u003d backup[\u0027status\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"970addb1_d5a6c6f8","line":604,"in_reply_to":"6cdc31ee_092fe08f","updated":"2021-06-08 03:24:58.000000000","message":"I thought we were populating messages specific to backups since we have multiple failure cases which will end up adding a lot of messages, but volume is an important resource for restore so it makes sense to add a message here too.","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"806af9aaa798a5f33f982a8bb14bba756a529790","unresolved":false,"context_lines":[{"line_number":601,"context_line":"                 (fields.VolumeStatus.ERROR if"},{"line_number":602,"context_line":"                  volume_previous_status \u003d\u003d fields.VolumeStatus.CREATING else"},{"line_number":603,"context_line":"                  fields.VolumeStatus.ERROR_RESTORING)})"},{"line_number":604,"context_line":"            raise exception.InvalidVolume(reason\u003derr)"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"        expected_status \u003d fields.BackupStatus.RESTORING"},{"line_number":607,"context_line":"        actual_status \u003d backup[\u0027status\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"f8a1ee6a_a1a0514e","line":604,"in_reply_to":"6f70f8d0_9ccffe59","updated":"2021-06-14 08:10:28.000000000","message":"Done","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"e927ab95cceebab81327701e9a7fc4bd590ae963","unresolved":true,"context_lines":[{"line_number":601,"context_line":"                 (fields.VolumeStatus.ERROR if"},{"line_number":602,"context_line":"                  volume_previous_status \u003d\u003d fields.VolumeStatus.CREATING else"},{"line_number":603,"context_line":"                  fields.VolumeStatus.ERROR_RESTORING)})"},{"line_number":604,"context_line":"            raise exception.InvalidVolume(reason\u003derr)"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"        expected_status \u003d fields.BackupStatus.RESTORING"},{"line_number":607,"context_line":"        actual_status \u003d backup[\u0027status\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"6f70f8d0_9ccffe59","line":604,"in_reply_to":"970addb1_d5a6c6f8","updated":"2021-06-08 11:05:29.000000000","message":"We were populating errors related to backups, and this is part of a backup operation, so I think we should be creating a user message for it.","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"749cfa27225df45e15fe35d49489aabcc110d9de","unresolved":true,"context_lines":[{"line_number":487,"context_line":"                    # We set message_create to True before creating the"},{"line_number":488,"context_line":"                    # message because if the message create call fails"},{"line_number":489,"context_line":"                    # and is catched by the base/outer exception handler"},{"line_number":490,"context_line":"                    # then we will end up logging a wrong message"},{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"ca893e4a_b9e4c6e8","line":490,"range":{"start_line":490,"start_character":42,"end_line":490,"end_character":49},"updated":"2021-06-21 16:58:20.000000000","message":"nit: \"storing\"","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"db811973349be5fd2747ceadcb512b2780aa8ad1","unresolved":false,"context_lines":[{"line_number":487,"context_line":"                    # We set message_create to True before creating the"},{"line_number":488,"context_line":"                    # message because if the message create call fails"},{"line_number":489,"context_line":"                    # and is catched by the base/outer exception handler"},{"line_number":490,"context_line":"                    # then we will end up logging a wrong message"},{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"066c23aa_715f25b9","line":490,"range":{"start_line":490,"start_character":42,"end_line":490,"end_character":49},"in_reply_to":"ca893e4a_b9e4c6e8","updated":"2021-06-22 06:37:37.000000000","message":"Done","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"},{"author":{"_account_id":30555,"name":"Fernando Ferraz","display_name":"Fernando Ferraz","email":"fesilva@redhat.com","username":"fernandoperches"},"change_message_id":"5142075d93eafc85718df757b654b6c29655c050","unresolved":true,"context_lines":[{"line_number":460,"context_line":"        self._notify_about_backup_usage(context, backup, \"create.end\")"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"    def _run_backup(self, context, backup, volume):"},{"line_number":463,"context_line":"        # Save a copy of the encryption key ID in case the volume is deleted."},{"line_number":464,"context_line":"        message_created \u003d False"},{"line_number":465,"context_line":"        if (volume.encryption_key_id is not None and"},{"line_number":466,"context_line":"                backup.encryption_key_id is None):"}],"source_content_type":"text/x-python","patch_set":18,"id":"218a17ef_372911b8","line":463,"updated":"2021-08-25 04:06:55.000000000","message":"nit: This comment should be moved to the line above if (volume.encryption_key_id is not None and ... \nas message_created has no relation with it.","commit_id":"5c61e0f236e76f31188e2645ce042fd96bc9478d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"bcd43d1b4b8e4a6f5f037b4b53810a8a06ec70e9","unresolved":false,"context_lines":[{"line_number":460,"context_line":"        self._notify_about_backup_usage(context, backup, \"create.end\")"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"    def _run_backup(self, context, backup, volume):"},{"line_number":463,"context_line":"        # Save a copy of the encryption key ID in case the volume is deleted."},{"line_number":464,"context_line":"        message_created \u003d False"},{"line_number":465,"context_line":"        if (volume.encryption_key_id is not None and"},{"line_number":466,"context_line":"                backup.encryption_key_id is None):"}],"source_content_type":"text/x-python","patch_set":18,"id":"d331a34e_f7ca548e","line":463,"in_reply_to":"218a17ef_372911b8","updated":"2021-08-25 04:38:24.000000000","message":"Done","commit_id":"5c61e0f236e76f31188e2645ce042fd96bc9478d"},{"author":{"_account_id":30555,"name":"Fernando Ferraz","display_name":"Fernando Ferraz","email":"fesilva@redhat.com","username":"fernandoperches"},"change_message_id":"5142075d93eafc85718df757b654b6c29655c050","unresolved":true,"context_lines":[{"line_number":556,"context_line":"                    context, backup)"},{"line_number":557,"context_line":"            except Exception as ex:"},{"line_number":558,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":559,"context_line":"                    if not message_created:"},{"line_number":560,"context_line":"                        self.message_api.create_from_request_context("},{"line_number":561,"context_line":"                            context,"},{"line_number":562,"context_line":"                            exception\u003dex,"}],"source_content_type":"text/x-python","patch_set":18,"id":"5b880381_598a1613","line":559,"updated":"2021-08-25 04:06:55.000000000","message":"Hi Rajat, is the cleanup message really unnecessary in case you have another message created? I\u0027m asking because the cleanup appears to be an independent operation that I understand it should work despite the result of the above ops. If the user get a error on backup_service.backup() and also on cleanup, only message BACKUP_CREATE_DRIVER_ERROR will be created.","commit_id":"5c61e0f236e76f31188e2645ce042fd96bc9478d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"bcd43d1b4b8e4a6f5f037b4b53810a8a06ec70e9","unresolved":true,"context_lines":[{"line_number":556,"context_line":"                    context, backup)"},{"line_number":557,"context_line":"            except Exception as ex:"},{"line_number":558,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":559,"context_line":"                    if not message_created:"},{"line_number":560,"context_line":"                        self.message_api.create_from_request_context("},{"line_number":561,"context_line":"                            context,"},{"line_number":562,"context_line":"                            exception\u003dex,"}],"source_content_type":"text/x-python","patch_set":18,"id":"c43684ec_adaed722","line":559,"in_reply_to":"5b880381_598a1613","updated":"2021-08-25 04:38:24.000000000","message":"This is done to avoid flooding the user with messages, if there is an error in both creating backup and cleanup, they should first fix the backup operation issue and execute it again (at least that\u0027s what my idea is while adding these messages). Also fixing the first issue might lead to automatically fixing the second issue as well. for eg: if a user gets error in backup create due to a temp volume/snapshot then fixing that would fix the cleanup as well. In summary, i don\u0027t feel it\u0027s a good idea to spam user with multiple messages and there should be only 1 error reason per operation.","commit_id":"5c61e0f236e76f31188e2645ce042fd96bc9478d"},{"author":{"_account_id":30555,"name":"Fernando Ferraz","display_name":"Fernando Ferraz","email":"fesilva@redhat.com","username":"fernandoperches"},"change_message_id":"4d35e172dacc2a3775e93aeb368d0fe5372ee216","unresolved":true,"context_lines":[{"line_number":556,"context_line":"                    context, backup)"},{"line_number":557,"context_line":"            except Exception as ex:"},{"line_number":558,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":559,"context_line":"                    if not message_created:"},{"line_number":560,"context_line":"                        self.message_api.create_from_request_context("},{"line_number":561,"context_line":"                            context,"},{"line_number":562,"context_line":"                            exception\u003dex,"}],"source_content_type":"text/x-python","patch_set":18,"id":"c760acf7_9a88da29","line":559,"in_reply_to":"c43684ec_adaed722","updated":"2021-08-25 11:55:46.000000000","message":"Rajat, thanks for the explanation! Yes, that makes sense.","commit_id":"5c61e0f236e76f31188e2645ce042fd96bc9478d"},{"author":{"_account_id":30555,"name":"Fernando Ferraz","display_name":"Fernando Ferraz","email":"fesilva@redhat.com","username":"fernandoperches"},"change_message_id":"5142075d93eafc85718df757b654b6c29655c050","unresolved":true,"context_lines":[{"line_number":754,"context_line":"            LOG.exception(\u0027Restoring backup %(backup_id)s to volume \u0027"},{"line_number":755,"context_line":"                          \u0027%(volume_id)s failed.\u0027, {\u0027backup_id\u0027: backup.id,"},{"line_number":756,"context_line":"                                                    \u0027volume_id\u0027: volume.id})"},{"line_number":757,"context_line":"            # We set message_create to True before creating the"},{"line_number":758,"context_line":"            # message because if the message create call fails"},{"line_number":759,"context_line":"            # and is catched by the base/outer exception handler"},{"line_number":760,"context_line":"            # then we will end up storing a wrong message"}],"source_content_type":"text/x-python","patch_set":18,"id":"f26af9bf_b9ef33b4","line":757,"updated":"2021-08-25 04:06:55.000000000","message":"good point","commit_id":"5c61e0f236e76f31188e2645ce042fd96bc9478d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"4d83d1873876eae82b351abe5818c97beaa7bf2f","unresolved":true,"context_lines":[{"line_number":345,"context_line":"        updates \u003d {}"},{"line_number":346,"context_line":"        context.message_resource_id \u003d backup.id"},{"line_number":347,"context_line":"        context.message_resource_type \u003d message_field.Resource.VOLUME_BACKUP"},{"line_number":348,"context_line":"        context.message_action \u003d message_field.Action.BACKUP_CREATE"},{"line_number":349,"context_line":"        if snapshot_id:"},{"line_number":350,"context_line":"            log_message \u003d (\u0027Create backup started, backup: %(backup_id)s \u0027"},{"line_number":351,"context_line":"                           \u0027volume: %(volume_id)s snapshot: %(snapshot_id)s.\u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"3a1d2561_6915a4d7","line":348,"updated":"2021-08-26 20:07:57.000000000","message":"This is clever, to pre-load the context and then all you have to do later is add the detail when you call the message_api.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"4d83d1873876eae82b351abe5818c97beaa7bf2f","unresolved":true,"context_lines":[{"line_number":395,"context_line":"            ex \u003d exception.InvalidBackup(reason\u003derr)"},{"line_number":396,"context_line":"            self.message_api.create_from_request_context("},{"line_number":397,"context_line":"                context,"},{"line_number":398,"context_line":"                exception\u003dex,"},{"line_number":399,"context_line":"                detail\u003dmessage_field.Detail.BACKUP_INVALID_STATE)"},{"line_number":400,"context_line":"            raise ex"},{"line_number":401,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"23a5ae47_1bae2495","line":398,"range":{"start_line":398,"start_character":16,"end_line":398,"end_character":28},"updated":"2021-08-26 20:07:57.000000000","message":"probably no point passing the exception, you just created it so you know exactly what it is and what message detail you want to use.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2510d8685011cb2ae87908b4aba7e63083d43a","unresolved":false,"context_lines":[{"line_number":395,"context_line":"            ex \u003d exception.InvalidBackup(reason\u003derr)"},{"line_number":396,"context_line":"            self.message_api.create_from_request_context("},{"line_number":397,"context_line":"                context,"},{"line_number":398,"context_line":"                exception\u003dex,"},{"line_number":399,"context_line":"                detail\u003dmessage_field.Detail.BACKUP_INVALID_STATE)"},{"line_number":400,"context_line":"            raise ex"},{"line_number":401,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"75c671d7_8750d36c","line":398,"range":{"start_line":398,"start_character":16,"end_line":398,"end_character":28},"in_reply_to":"23a5ae47_1bae2495","updated":"2021-08-27 10:10:55.000000000","message":"Done\nI added this to keep it consistent with the previous messages we have, but agree that it doesn\u0027t serve any purpose to the functionality here.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"4d83d1873876eae82b351abe5818c97beaa7bf2f","unresolved":true,"context_lines":[{"line_number":406,"context_line":"                ex \u003d exception.InvalidBackup(reason\u003derr)"},{"line_number":407,"context_line":"                self.message_api.create_from_request_context("},{"line_number":408,"context_line":"                    context,"},{"line_number":409,"context_line":"                    exception\u003dex,"},{"line_number":410,"context_line":"                    detail\u003dmessage_field.Detail.BACKUP_SERVICE_DOWN)"},{"line_number":411,"context_line":"                raise ex"},{"line_number":412,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"88d5dfba_0bc91c79","line":409,"range":{"start_line":409,"start_character":20,"end_line":409,"end_character":33},"updated":"2021-08-26 20:07:57.000000000","message":"same here, you know what detail you want to provide, and if InvalidBackup is added to the mapping for some reason, you don\u0027t want the mapped message, you want backup_service_down.  So I think don\u0027t pass the exception.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2510d8685011cb2ae87908b4aba7e63083d43a","unresolved":false,"context_lines":[{"line_number":406,"context_line":"                ex \u003d exception.InvalidBackup(reason\u003derr)"},{"line_number":407,"context_line":"                self.message_api.create_from_request_context("},{"line_number":408,"context_line":"                    context,"},{"line_number":409,"context_line":"                    exception\u003dex,"},{"line_number":410,"context_line":"                    detail\u003dmessage_field.Detail.BACKUP_SERVICE_DOWN)"},{"line_number":411,"context_line":"                raise ex"},{"line_number":412,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"d67f5dc5_12880baa","line":409,"range":{"start_line":409,"start_character":20,"end_line":409,"end_character":33},"in_reply_to":"88d5dfba_0bc91c79","updated":"2021-08-27 10:10:55.000000000","message":"Done","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"4d83d1873876eae82b351abe5818c97beaa7bf2f","unresolved":true,"context_lines":[{"line_number":484,"context_line":"                                                                     volume)"},{"line_number":485,"context_line":"            except Exception as ex:"},{"line_number":486,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":487,"context_line":"                    # We set message_create to True before creating the"},{"line_number":488,"context_line":"                    # message because if the message create call fails"},{"line_number":489,"context_line":"                    # and is catched by the base/outer exception handler"},{"line_number":490,"context_line":"                    # then we will end up storing a wrong message"},{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"}],"source_content_type":"text/x-python","patch_set":19,"id":"869f291c_819dd9cd","line":490,"range":{"start_line":487,"start_character":0,"end_line":490,"end_character":65},"updated":"2021-08-26 20:07:57.000000000","message":"Is this really a concern?  (I mean, thinking about it like you have here is definitely good, but I\u0027m wondering whether we\u0027ll ever actually see this.)  The message creation is in its own try block that catches an Exception and logs it (doesn\u0027t re-raise).  Plus we have unit tests that should at least catch a problem is the string template in the message_record is malformed or something.  Though looking at the code, it does mess around with timeutils and stuff before the try block.  Maybe the thing to do is to put everything in the create function into a big try block so we can guarantee that the message generation won\u0027t raise an exception.  That would make it easier to use, and I think that was the idea behind it catching Exception.  Let\u0027s see what Gorka thinks.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2510d8685011cb2ae87908b4aba7e63083d43a","unresolved":true,"context_lines":[{"line_number":484,"context_line":"                                                                     volume)"},{"line_number":485,"context_line":"            except Exception as ex:"},{"line_number":486,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":487,"context_line":"                    # We set message_create to True before creating the"},{"line_number":488,"context_line":"                    # message because if the message create call fails"},{"line_number":489,"context_line":"                    # and is catched by the base/outer exception handler"},{"line_number":490,"context_line":"                    # then we will end up storing a wrong message"},{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"}],"source_content_type":"text/x-python","patch_set":19,"id":"9204d6c8_0b8f36ee","line":490,"range":{"start_line":487,"start_character":0,"end_line":490,"end_character":65},"in_reply_to":"869f291c_819dd9cd","updated":"2021-08-27 10:10:55.000000000","message":"I haven\u0027t faced that in a practical usecase but Even if it is not a concern, the only change here is to move message_created \u003d True after the message is created which IMO doesn\u0027t change anything.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"092b32650e184543ff28cd77da71524f6120f584","unresolved":true,"context_lines":[{"line_number":484,"context_line":"                                                                     volume)"},{"line_number":485,"context_line":"            except Exception as ex:"},{"line_number":486,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":487,"context_line":"                    # We set message_create to True before creating the"},{"line_number":488,"context_line":"                    # message because if the message create call fails"},{"line_number":489,"context_line":"                    # and is catched by the base/outer exception handler"},{"line_number":490,"context_line":"                    # then we will end up storing a wrong message"},{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"}],"source_content_type":"text/x-python","patch_set":19,"id":"e0e01bd2_2ea4c7b1","line":490,"range":{"start_line":487,"start_character":0,"end_line":490,"end_character":65},"in_reply_to":"9204d6c8_0b8f36ee","updated":"2021-08-27 12:48:26.000000000","message":"Sure, but the idea behind the user messages is that they should be like a log message, that is, you just add a statement and don\u0027t have to think about it.  I don\u0027t like the idea of adding logic to handle these because it complicates the function for reasons that have nothing to do with the purpose of the function.  Plus, it\u0027s always possible for the logic to have a mistake in it, and it\u0027s better not to have to worry about that.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"0badfcc5abb7d853e1e2b3b0e2ae1f2116c15d44","unresolved":true,"context_lines":[{"line_number":484,"context_line":"                                                                     volume)"},{"line_number":485,"context_line":"            except Exception as ex:"},{"line_number":486,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":487,"context_line":"                    # We set message_create to True before creating the"},{"line_number":488,"context_line":"                    # message because if the message create call fails"},{"line_number":489,"context_line":"                    # and is catched by the base/outer exception handler"},{"line_number":490,"context_line":"                    # then we will end up storing a wrong message"},{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"}],"source_content_type":"text/x-python","patch_set":19,"id":"028aa851_275081ec","line":490,"range":{"start_line":487,"start_character":0,"end_line":490,"end_character":65},"in_reply_to":"d76a8167_c2927e34","updated":"2021-09-01 12:55:19.000000000","message":"Sure, but my point is that I don\u0027t like adding extra logic to manage whether messages get produced or not in a function like this that has a completely different responsibility.  Is it possible to enhance the internal messages api so that it can detect multiple messages for the same event, and only store the first one?  I\u0027d rather put effort into that, because then we can have the messages api unit tested thoroughly to be sure it works instead of individually testing each function to make sure the appropriate message is generated under various circumstances.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"7fca325aeec0807a923685ff2fa39d3c9a57e229","unresolved":true,"context_lines":[{"line_number":484,"context_line":"                                                                     volume)"},{"line_number":485,"context_line":"            except Exception as ex:"},{"line_number":486,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":487,"context_line":"                    # We set message_create to True before creating the"},{"line_number":488,"context_line":"                    # message because if the message create call fails"},{"line_number":489,"context_line":"                    # and is catched by the base/outer exception handler"},{"line_number":490,"context_line":"                    # then we will end up storing a wrong message"},{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"}],"source_content_type":"text/x-python","patch_set":19,"id":"d76a8167_c2927e34","line":490,"range":{"start_line":487,"start_character":0,"end_line":490,"end_character":65},"in_reply_to":"e0e01bd2_2ea4c7b1","updated":"2021-08-30 09:00:16.000000000","message":"I believe it is a concern, and iirc I was the one who raised it in a previous patch.\n\nIf the RPC call to create the temporary device fails here, then it is likely that the call to cleanup temp resources (on L555) will also fail and we\u0027ll create both messages, which could be misleading for users, since the last error is consequence of the one happening here and irrelevant for the end user.\n\nIt all boils down to whether we want to report every individual error or just the root cause of the operation failure.\n\nI think for users we should only report the initial one.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"4d83d1873876eae82b351abe5818c97beaa7bf2f","unresolved":true,"context_lines":[{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"},{"line_number":494,"context_line":"                        exception\u003dex,"},{"line_number":495,"context_line":"                        detail\u003d"},{"line_number":496,"context_line":"                        message_field.Detail.BACKUP_CREATE_DEVICE_ERROR)"},{"line_number":497,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":19,"id":"150df9d0_8a0be8f2","line":494,"range":{"start_line":494,"start_character":24,"end_line":494,"end_character":36},"updated":"2021-08-26 20:07:57.000000000","message":"the more I think about this, the less I like the exception mapping.  It\u0027s supposedly designed for this situation, when we\u0027re catching an Exception that could be anything, but on the other hand, we know exactly what message detail we want to use.  So I think it\u0027s better not to pass the exception here (and probably throughout this file).","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2510d8685011cb2ae87908b4aba7e63083d43a","unresolved":false,"context_lines":[{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"},{"line_number":494,"context_line":"                        exception\u003dex,"},{"line_number":495,"context_line":"                        detail\u003d"},{"line_number":496,"context_line":"                        message_field.Detail.BACKUP_CREATE_DEVICE_ERROR)"},{"line_number":497,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bcf12661_cfd0ca83","line":494,"range":{"start_line":494,"start_character":24,"end_line":494,"end_character":36},"in_reply_to":"150df9d0_8a0be8f2","updated":"2021-08-27 10:10:55.000000000","message":"Done\nAgree, We should consider refactoring existing messages in a patch to avoid this confusion.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"0badfcc5abb7d853e1e2b3b0e2ae1f2116c15d44","unresolved":true,"context_lines":[{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"},{"line_number":494,"context_line":"                        exception\u003dex,"},{"line_number":495,"context_line":"                        detail\u003d"},{"line_number":496,"context_line":"                        message_field.Detail.BACKUP_CREATE_DEVICE_ERROR)"},{"line_number":497,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":19,"id":"fec0579d_d3034aad","line":494,"range":{"start_line":494,"start_character":24,"end_line":494,"end_character":36},"in_reply_to":"3762db88_456ad61e","updated":"2021-09-01 12:55:19.000000000","message":"I guess I wasn\u0027t clear on any of my comments!  I was talking about removing the exception mapping (not removing the possibility of passing exceptions) because an exception in the mapping will override the passed message detail, and the only way to prevent that is to not pass the exception.  It would be easier if we could be consistent and not think about it, so for example, we could change the logic so the mapping is only used if no message detail is passed, which actually is more intuitive  and is probably how most people think this feature works.  Then you just pass whatever you have available to the messages api and let it sort out what to do.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"7fca325aeec0807a923685ff2fa39d3c9a57e229","unresolved":false,"context_lines":[{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"},{"line_number":494,"context_line":"                        exception\u003dex,"},{"line_number":495,"context_line":"                        detail\u003d"},{"line_number":496,"context_line":"                        message_field.Detail.BACKUP_CREATE_DEVICE_ERROR)"},{"line_number":497,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":19,"id":"3762db88_456ad61e","line":494,"range":{"start_line":494,"start_character":24,"end_line":494,"end_character":36},"in_reply_to":"41019bcf_5c3446de","updated":"2021-08-30 09:00:16.000000000","message":"I like the idea of passing the exceptions, because it allows us to expand, in the future, the message api to store the exception traceback and make it only visible to administrators.\n\nBut now I see that Rajat already removed it on the next patch, so no reason to add it again now.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"092b32650e184543ff28cd77da71524f6120f584","unresolved":true,"context_lines":[{"line_number":491,"context_line":"                    message_created \u003d True"},{"line_number":492,"context_line":"                    self.message_api.create_from_request_context("},{"line_number":493,"context_line":"                        context,"},{"line_number":494,"context_line":"                        exception\u003dex,"},{"line_number":495,"context_line":"                        detail\u003d"},{"line_number":496,"context_line":"                        message_field.Detail.BACKUP_CREATE_DEVICE_ERROR)"},{"line_number":497,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":19,"id":"41019bcf_5c3446de","line":494,"range":{"start_line":494,"start_character":24,"end_line":494,"end_character":36},"in_reply_to":"bcf12661_cfd0ca83","updated":"2021-08-27 12:48:26.000000000","message":"I agree.  The original design sounds like it would be useful, but we should re-assess the locations where an exception is passed to see whether it makes sense or not.  And if it doesn\u0027t make sense in any of the current locations, then we should just remove it, because it confuses developers, and the idea behind user messages is that they should be easy to add and you shouldn\u0027t have to think about them.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"}],"cinder/context.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"749cfa27225df45e15fe35d49489aabcc110d9de","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            timestamp \u003d timeutils.parse_isotime(timestamp)"},{"line_number":109,"context_line":"        self.timestamp \u003d timestamp"},{"line_number":110,"context_line":"        self.quota_class \u003d quota_class"},{"line_number":111,"context_line":"        self.message_resource_id \u003d None"},{"line_number":112,"context_line":"        self.message_resource_type \u003d None"},{"line_number":113,"context_line":"        self.message_action \u003d None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        if service_catalog:"}],"source_content_type":"text/x-python","patch_set":10,"id":"c19f2399_c374cb07","line":112,"range":{"start_line":111,"start_character":0,"end_line":112,"end_character":41},"updated":"2021-06-21 16:58:20.000000000","message":"We may need to rename it in the future to something like \"primary_resource_id\" and \"primary_resource_type\" if we end up using it for other things, but for now I like this naming.","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"db811973349be5fd2747ceadcb512b2780aa8ad1","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            timestamp \u003d timeutils.parse_isotime(timestamp)"},{"line_number":109,"context_line":"        self.timestamp \u003d timestamp"},{"line_number":110,"context_line":"        self.quota_class \u003d quota_class"},{"line_number":111,"context_line":"        self.message_resource_id \u003d None"},{"line_number":112,"context_line":"        self.message_resource_type \u003d None"},{"line_number":113,"context_line":"        self.message_action \u003d None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        if service_catalog:"}],"source_content_type":"text/x-python","patch_set":10,"id":"7695e5c5_5a166f81","line":112,"range":{"start_line":111,"start_character":0,"end_line":112,"end_character":41},"in_reply_to":"c19f2399_c374cb07","updated":"2021-06-22 06:37:37.000000000","message":"Ack","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"}],"cinder/message/api.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"749cfa27225df45e15fe35d49489aabcc110d9de","unresolved":true,"context_lines":[{"line_number":116,"context_line":"        \"\"\"Create a message record with the specified information."},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        :param context:"},{"line_number":119,"context_line":"            current context object which contains the message_action,"},{"line_number":120,"context_line":"            message_resource_type and message_resource_id fields"},{"line_number":121,"context_line":"        :param exception:"},{"line_number":122,"context_line":"            if an exception has occurred, you can pass it in and it will be"}],"source_content_type":"text/x-python","patch_set":10,"id":"10e9c197_788d9454","line":119,"range":{"start_line":119,"start_character":41,"end_line":119,"end_character":49},"updated":"2021-06-21 16:58:20.000000000","message":"nit: \"we must have populated with\"","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"db811973349be5fd2747ceadcb512b2780aa8ad1","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        \"\"\"Create a message record with the specified information."},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        :param context:"},{"line_number":119,"context_line":"            current context object which contains the message_action,"},{"line_number":120,"context_line":"            message_resource_type and message_resource_id fields"},{"line_number":121,"context_line":"        :param exception:"},{"line_number":122,"context_line":"            if an exception has occurred, you can pass it in and it will be"}],"source_content_type":"text/x-python","patch_set":10,"id":"9c256648_32f5c655","line":119,"range":{"start_line":119,"start_character":41,"end_line":119,"end_character":49},"in_reply_to":"10e9c197_788d9454","updated":"2021-06-22 06:37:37.000000000","message":"Done","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"749cfa27225df45e15fe35d49489aabcc110d9de","unresolved":true,"context_lines":[{"line_number":136,"context_line":"            values are \u0027INFO\u0027, \u0027ERROR\u0027, \u0027WARNING\u0027.  Default is \u0027ERROR\u0027."},{"line_number":137,"context_line":"        \"\"\""},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        LOG.info(\"Creating message record for request_id \u003d %s\","},{"line_number":140,"context_line":"                 context.request_id)"},{"line_number":141,"context_line":"        # Updates expiry time for message as per message_ttl config."},{"line_number":142,"context_line":"        expires_at \u003d (timeutils.utcnow() + datetime.timedelta("}],"source_content_type":"text/x-python","patch_set":10,"id":"b4c6431b_7138f730","line":139,"range":{"start_line":139,"start_character":12,"end_line":139,"end_character":16},"updated":"2021-06-21 16:58:20.000000000","message":"-1: `info(_(`","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"736073a1dee46dfdb2df2cc91931d051bba6e03c","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            values are \u0027INFO\u0027, \u0027ERROR\u0027, \u0027WARNING\u0027.  Default is \u0027ERROR\u0027."},{"line_number":137,"context_line":"        \"\"\""},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        LOG.info(\"Creating message record for request_id \u003d %s\","},{"line_number":140,"context_line":"                 context.request_id)"},{"line_number":141,"context_line":"        # Updates expiry time for message as per message_ttl config."},{"line_number":142,"context_line":"        expires_at \u003d (timeutils.utcnow() + datetime.timedelta("}],"source_content_type":"text/x-python","patch_set":10,"id":"9560dcba_86f2a628","line":139,"range":{"start_line":139,"start_character":12,"end_line":139,"end_character":16},"in_reply_to":"6ac58479_5a2c1ae7","updated":"2021-06-22 16:51:04.000000000","message":"I forgot we also removed it for info level, sorry.","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"db811973349be5fd2747ceadcb512b2780aa8ad1","unresolved":true,"context_lines":[{"line_number":136,"context_line":"            values are \u0027INFO\u0027, \u0027ERROR\u0027, \u0027WARNING\u0027.  Default is \u0027ERROR\u0027."},{"line_number":137,"context_line":"        \"\"\""},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        LOG.info(\"Creating message record for request_id \u003d %s\","},{"line_number":140,"context_line":"                 context.request_id)"},{"line_number":141,"context_line":"        # Updates expiry time for message as per message_ttl config."},{"line_number":142,"context_line":"        expires_at \u003d (timeutils.utcnow() + datetime.timedelta("}],"source_content_type":"text/x-python","patch_set":10,"id":"6ac58479_5a2c1ae7","line":139,"range":{"start_line":139,"start_character":12,"end_line":139,"end_character":16},"in_reply_to":"b4c6431b_7138f730","updated":"2021-06-22 06:37:37.000000000","message":"Referencing to this patch[1], we\u0027ve removed translation in logging since Pike release and pep8 gives error for the same.\n\n[1] https://github.com/openstack/cinder/commit/7b71585aa1e4bb116ce183f6e2879a1951738fc6","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"749cfa27225df45e15fe35d49489aabcc110d9de","unresolved":true,"context_lines":[{"line_number":155,"context_line":"                              detail_id),"},{"line_number":156,"context_line":"                          \u0027detail_id\u0027: detail_id,"},{"line_number":157,"context_line":"                          \u0027expires_at\u0027: expires_at}"},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            self.db.message_create(context, message_record)"},{"line_number":160,"context_line":"        except Exception:"},{"line_number":161,"context_line":"            LOG.exception(\"Failed to create message record \""}],"source_content_type":"text/x-python","patch_set":10,"id":"79f0a8ea_23138293","line":158,"range":{"start_line":158,"start_character":8,"end_line":158,"end_character":12},"updated":"2021-06-21 16:58:20.000000000","message":"nit: If we move the `try:` to the top of the method we can remove `with excutils.save_and_reraise_exception():` from callers, which make the caller code cleaner.","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"736073a1dee46dfdb2df2cc91931d051bba6e03c","unresolved":true,"context_lines":[{"line_number":155,"context_line":"                              detail_id),"},{"line_number":156,"context_line":"                          \u0027detail_id\u0027: detail_id,"},{"line_number":157,"context_line":"                          \u0027expires_at\u0027: expires_at}"},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            self.db.message_create(context, message_record)"},{"line_number":160,"context_line":"        except Exception:"},{"line_number":161,"context_line":"            LOG.exception(\"Failed to create message record \""}],"source_content_type":"text/x-python","patch_set":10,"id":"bbcfe332_2ebf63be","line":158,"range":{"start_line":158,"start_character":8,"end_line":158,"end_character":12},"in_reply_to":"6a1f7b72_9d9f658a","updated":"2021-06-22 16:51:04.000000000","message":"If we move the \"try:\" to the top of the method then this method will never raise an exception, hence the caller doesn\u0027t need to use the \"save_and_reraise_exception\" pattern.","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"db811973349be5fd2747ceadcb512b2780aa8ad1","unresolved":true,"context_lines":[{"line_number":155,"context_line":"                              detail_id),"},{"line_number":156,"context_line":"                          \u0027detail_id\u0027: detail_id,"},{"line_number":157,"context_line":"                          \u0027expires_at\u0027: expires_at}"},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            self.db.message_create(context, message_record)"},{"line_number":160,"context_line":"        except Exception:"},{"line_number":161,"context_line":"            LOG.exception(\"Failed to create message record \""}],"source_content_type":"text/x-python","patch_set":10,"id":"6a1f7b72_9d9f658a","line":158,"range":{"start_line":158,"start_character":8,"end_line":158,"end_character":12},"in_reply_to":"79f0a8ea_23138293","updated":"2021-06-22 06:37:37.000000000","message":"Sorry i didn\u0027t understand. the save_and_reraise_exception part is related to those methods raising their original exception so the outer exception/finally block will catch them and they don\u0027t proceed for normal execution. I\u0027m not sure how moving this will help us remove those parts? am i missing something here?","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8a44d1510429bb05f316a17b5a048fec8701cd35","unresolved":true,"context_lines":[{"line_number":149,"context_line":"                          \u0027request_id\u0027: context.request_id,"},{"line_number":150,"context_line":"                          \u0027resource_type\u0027: context.message_resource_type,"},{"line_number":151,"context_line":"                          \u0027resource_uuid\u0027: context.message_resource_id,"},{"line_number":152,"context_line":"                          \u0027action_id\u0027: action[0] if action else \u0027\u0027,"},{"line_number":153,"context_line":"                          \u0027message_level\u0027: level,"},{"line_number":154,"context_line":"                          \u0027event_id\u0027: \"VOLUME_%s_%s_%s\" % ("},{"line_number":155,"context_line":"                              context.message_resource_type,"},{"line_number":156,"context_line":"                              action[0],"},{"line_number":157,"context_line":"                              detail_id),"},{"line_number":158,"context_line":"                          \u0027detail_id\u0027: detail_id,"},{"line_number":159,"context_line":"                          \u0027expires_at\u0027: expires_at}"}],"source_content_type":"text/x-python","patch_set":15,"id":"21f28932_94bf3aa0","line":156,"range":{"start_line":152,"start_character":39,"end_line":156,"end_character":40},"updated":"2021-06-30 10:00:37.000000000","message":"-1: If action can be None (L152), then we cannot do `action[0]` on L156.\n\nSince we have documented that \"message_action\" must be set before calling the method I think we should assume it is set and just do action[0].\n\nSo I would change L147 to: \"action_id \u003d context.message_action[0]\" and then use in on L152 and L156.","commit_id":"378f3380733b59e9b9babfb30608e653b81d1091"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"c27565020cd023e989fe5c1ace119ecb5c391370","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                          \u0027request_id\u0027: context.request_id,"},{"line_number":150,"context_line":"                          \u0027resource_type\u0027: context.message_resource_type,"},{"line_number":151,"context_line":"                          \u0027resource_uuid\u0027: context.message_resource_id,"},{"line_number":152,"context_line":"                          \u0027action_id\u0027: action[0] if action else \u0027\u0027,"},{"line_number":153,"context_line":"                          \u0027message_level\u0027: level,"},{"line_number":154,"context_line":"                          \u0027event_id\u0027: \"VOLUME_%s_%s_%s\" % ("},{"line_number":155,"context_line":"                              context.message_resource_type,"},{"line_number":156,"context_line":"                              action[0],"},{"line_number":157,"context_line":"                              detail_id),"},{"line_number":158,"context_line":"                          \u0027detail_id\u0027: detail_id,"},{"line_number":159,"context_line":"                          \u0027expires_at\u0027: expires_at}"}],"source_content_type":"text/x-python","patch_set":15,"id":"c0a7d0a3_0e358296","line":156,"range":{"start_line":152,"start_character":39,"end_line":156,"end_character":40},"in_reply_to":"21f28932_94bf3aa0","updated":"2021-06-30 10:15:31.000000000","message":"Done","commit_id":"378f3380733b59e9b9babfb30608e653b81d1091"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"4d83d1873876eae82b351abe5818c97beaa7bf2f","unresolved":true,"context_lines":[{"line_number":137,"context_line":"            values are \u0027INFO\u0027, \u0027ERROR\u0027, \u0027WARNING\u0027.  Default is \u0027ERROR\u0027."},{"line_number":138,"context_line":"        \"\"\""},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        LOG.info(\"Creating message record for request_id \u003d %s\","},{"line_number":141,"context_line":"                 context.request_id)"},{"line_number":142,"context_line":"        # Updates expiry time for message as per message_ttl config."},{"line_number":143,"context_line":"        expires_at \u003d (timeutils.utcnow() + datetime.timedelta("},{"line_number":144,"context_line":"                      seconds\u003dCONF.message_ttl))"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        detail_id \u003d message_field.translate_detail_id(exception, detail)"},{"line_number":147,"context_line":"        action_id \u003d context.message_action[0]"},{"line_number":148,"context_line":"        message_record \u003d {\u0027project_id\u0027: context.project_id,"},{"line_number":149,"context_line":"                          \u0027request_id\u0027: context.request_id,"},{"line_number":150,"context_line":"                          \u0027resource_type\u0027: context.message_resource_type,"},{"line_number":151,"context_line":"                          \u0027resource_uuid\u0027: context.message_resource_id,"},{"line_number":152,"context_line":"                          \u0027action_id\u0027: action_id,"},{"line_number":153,"context_line":"                          \u0027message_level\u0027: level,"},{"line_number":154,"context_line":"                          \u0027event_id\u0027: \"VOLUME_%s_%s_%s\" % ("},{"line_number":155,"context_line":"                              context.message_resource_type,"},{"line_number":156,"context_line":"                              action_id,"},{"line_number":157,"context_line":"                              detail_id),"},{"line_number":158,"context_line":"                          \u0027detail_id\u0027: detail_id,"},{"line_number":159,"context_line":"                          \u0027expires_at\u0027: expires_at}"},{"line_number":160,"context_line":"        try:"},{"line_number":161,"context_line":"            self.db.message_create(context, message_record)"},{"line_number":162,"context_line":"        except Exception:"},{"line_number":163,"context_line":"            LOG.exception(\"Failed to create message record \""},{"line_number":164,"context_line":"                          \"for request_id %s\", context.request_id)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def get(self, context, id):"},{"line_number":167,"context_line":"        \"\"\"Return message with the specified id.\"\"\""},{"line_number":168,"context_line":"        return self.db.message_get(context, id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"46071544_36cddc61","line":165,"range":{"start_line":140,"start_character":0,"end_line":165,"end_character":0},"updated":"2021-08-26 20:07:57.000000000","message":"I think you could replace the entire body of this function with:\n\n        self.create(context\u003dcontext,\n                    action\u003dcontext.message_action,\n                    resource_type\u003dcontext.message_resource_type,\n                    resource_uuid\u003dcontext.message_resource_id,\n                    exception\u003dexception,\n                    detail\u003ddetail,\n                    level\u003dlevel)\n\nand then you\u0027d avoid code duplication (unless there\u0027s a difference I\u0027m not seeing).","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2510d8685011cb2ae87908b4aba7e63083d43a","unresolved":false,"context_lines":[{"line_number":137,"context_line":"            values are \u0027INFO\u0027, \u0027ERROR\u0027, \u0027WARNING\u0027.  Default is \u0027ERROR\u0027."},{"line_number":138,"context_line":"        \"\"\""},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        LOG.info(\"Creating message record for request_id \u003d %s\","},{"line_number":141,"context_line":"                 context.request_id)"},{"line_number":142,"context_line":"        # Updates expiry time for message as per message_ttl config."},{"line_number":143,"context_line":"        expires_at \u003d (timeutils.utcnow() + datetime.timedelta("},{"line_number":144,"context_line":"                      seconds\u003dCONF.message_ttl))"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        detail_id \u003d message_field.translate_detail_id(exception, detail)"},{"line_number":147,"context_line":"        action_id \u003d context.message_action[0]"},{"line_number":148,"context_line":"        message_record \u003d {\u0027project_id\u0027: context.project_id,"},{"line_number":149,"context_line":"                          \u0027request_id\u0027: context.request_id,"},{"line_number":150,"context_line":"                          \u0027resource_type\u0027: context.message_resource_type,"},{"line_number":151,"context_line":"                          \u0027resource_uuid\u0027: context.message_resource_id,"},{"line_number":152,"context_line":"                          \u0027action_id\u0027: action_id,"},{"line_number":153,"context_line":"                          \u0027message_level\u0027: level,"},{"line_number":154,"context_line":"                          \u0027event_id\u0027: \"VOLUME_%s_%s_%s\" % ("},{"line_number":155,"context_line":"                              context.message_resource_type,"},{"line_number":156,"context_line":"                              action_id,"},{"line_number":157,"context_line":"                              detail_id),"},{"line_number":158,"context_line":"                          \u0027detail_id\u0027: detail_id,"},{"line_number":159,"context_line":"                          \u0027expires_at\u0027: expires_at}"},{"line_number":160,"context_line":"        try:"},{"line_number":161,"context_line":"            self.db.message_create(context, message_record)"},{"line_number":162,"context_line":"        except Exception:"},{"line_number":163,"context_line":"            LOG.exception(\"Failed to create message record \""},{"line_number":164,"context_line":"                          \"for request_id %s\", context.request_id)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def get(self, context, id):"},{"line_number":167,"context_line":"        \"\"\"Return message with the specified id.\"\"\""},{"line_number":168,"context_line":"        return self.db.message_get(context, id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"bd3a8572_410bc208","line":165,"range":{"start_line":140,"start_character":0,"end_line":165,"end_character":0},"in_reply_to":"46071544_36cddc61","updated":"2021-08-27 10:10:55.000000000","message":"Done","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"}],"cinder/message/message_field.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"de2fa829904f78899bb5965c800dabe8091281dd","unresolved":true,"context_lines":[{"line_number":109,"context_line":"    SNAPSHOT_DELETE_ERROR \u003d (\u0027016\u0027, _(\"Snapshot failed to delete.\"))"},{"line_number":110,"context_line":"    BACKUP_INVALID_STATE \u003d (\u0027017\u0027, _(\"Backup status is invalid.\"))"},{"line_number":111,"context_line":"    BACKUP_SERVICE_DOWN \u003d (\u0027018\u0027, _(\"Backup service is down.\"))"},{"line_number":112,"context_line":"    BACKUP_CREATE_DEVICE_ERROR \u003d (\u0027019\u0027, _(\"Failed to get backup device.\"))"},{"line_number":113,"context_line":"    BACKUP_CREATE_ATTACH_DETACH_ERROR \u003d ("},{"line_number":114,"context_line":"        \u0027020\u0027,"},{"line_number":115,"context_line":"        (\"Either failed to attach/detach backup device or backup operation \""}],"source_content_type":"text/x-python","patch_set":7,"id":"d1ed3a06_2cab14f0","line":112,"updated":"2021-06-07 13:14:07.000000000","message":"nit: \"Failed to get backup device from the volume service.\"","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33de2e6fcd161d8353e29fcc909944f3ea7df560","unresolved":false,"context_lines":[{"line_number":109,"context_line":"    SNAPSHOT_DELETE_ERROR \u003d (\u0027016\u0027, _(\"Snapshot failed to delete.\"))"},{"line_number":110,"context_line":"    BACKUP_INVALID_STATE \u003d (\u0027017\u0027, _(\"Backup status is invalid.\"))"},{"line_number":111,"context_line":"    BACKUP_SERVICE_DOWN \u003d (\u0027018\u0027, _(\"Backup service is down.\"))"},{"line_number":112,"context_line":"    BACKUP_CREATE_DEVICE_ERROR \u003d (\u0027019\u0027, _(\"Failed to get backup device.\"))"},{"line_number":113,"context_line":"    BACKUP_CREATE_ATTACH_DETACH_ERROR \u003d ("},{"line_number":114,"context_line":"        \u0027020\u0027,"},{"line_number":115,"context_line":"        (\"Either failed to attach/detach backup device or backup operation \""}],"source_content_type":"text/x-python","patch_set":7,"id":"217a413c_3fff4577","line":112,"in_reply_to":"d1ed3a06_2cab14f0","updated":"2021-06-08 03:24:58.000000000","message":"Done","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"de2fa829904f78899bb5965c800dabe8091281dd","unresolved":true,"context_lines":[{"line_number":121,"context_line":"        (\"Backup failed to schedule. Service not found for creating backup.\"))"},{"line_number":122,"context_line":"    BACKUP_DELETE_ERROR \u003d (\u0027023\u0027, _(\"Backup failed to delete.\"))"},{"line_number":123,"context_line":"    BACKUP_RESTORE_ERROR \u003d (\u0027024\u0027, _(\"Failed to restore backup.\"))"},{"line_number":124,"context_line":"    BACKUP_RESTORE_ATTACH_ERROR \u003d (\u0027025\u0027, _(\"Failed to attach volume.\"))"},{"line_number":125,"context_line":"    BACKUP_RESTORE_DETACH_ERROR \u003d (\u0027026\u0027, _(\"Failed to detach volume.\"))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    ALL \u003d (UNKNOWN_ERROR,"},{"line_number":128,"context_line":"           DRIVER_NOT_INITIALIZED,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7dbfde78_72cbbaa0","line":125,"range":{"start_line":124,"start_character":0,"end_line":125,"end_character":72},"updated":"2021-06-07 13:14:07.000000000","message":"-1: We should make give these generic names, since we\u0027ll be using them a lot in the Cinder code: ATTACH_ERROR and DETACH_ERROR should be ok.","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"33de2e6fcd161d8353e29fcc909944f3ea7df560","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        (\"Backup failed to schedule. Service not found for creating backup.\"))"},{"line_number":122,"context_line":"    BACKUP_DELETE_ERROR \u003d (\u0027023\u0027, _(\"Backup failed to delete.\"))"},{"line_number":123,"context_line":"    BACKUP_RESTORE_ERROR \u003d (\u0027024\u0027, _(\"Failed to restore backup.\"))"},{"line_number":124,"context_line":"    BACKUP_RESTORE_ATTACH_ERROR \u003d (\u0027025\u0027, _(\"Failed to attach volume.\"))"},{"line_number":125,"context_line":"    BACKUP_RESTORE_DETACH_ERROR \u003d (\u0027026\u0027, _(\"Failed to detach volume.\"))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    ALL \u003d (UNKNOWN_ERROR,"},{"line_number":128,"context_line":"           DRIVER_NOT_INITIALIZED,"}],"source_content_type":"text/x-python","patch_set":7,"id":"63b3b052_29e9d99a","line":125,"range":{"start_line":124,"start_character":0,"end_line":125,"end_character":72},"in_reply_to":"7dbfde78_72cbbaa0","updated":"2021-06-08 03:24:58.000000000","message":"Done","commit_id":"e344eabdc52227ded4f1ba3b81ab8547920e0e79"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"749cfa27225df45e15fe35d49489aabcc110d9de","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        \u0027025\u0027, _(\"Backup driver failed to delete backup.\"))"},{"line_number":125,"context_line":"    BACKUP_RESTORE_ERROR \u003d ("},{"line_number":126,"context_line":"        \u0027026\u0027, _(\"Backup driver failed to restore backup.\"))"},{"line_number":127,"context_line":"    VOLUME_INVALID_STATE \u003d (\u0027027\u0027, _(\"Volume status is invalid.\"))"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    ALL \u003d (UNKNOWN_ERROR,"},{"line_number":130,"context_line":"           DRIVER_NOT_INITIALIZED,"}],"source_content_type":"text/x-python","patch_set":10,"id":"4d9d0ee5_5ff14ca7","line":127,"range":{"start_line":127,"start_character":4,"end_line":127,"end_character":24},"updated":"2021-06-21 16:58:20.000000000","message":"This is a state we\u0027ll be able to reuse for other errors.  :-)","commit_id":"cf86984fafe929bdcdc7b75678794de8b91befc6"}],"cinder/scheduler/manager.py":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"4d83d1873876eae82b351abe5818c97beaa7bf2f","unresolved":true,"context_lines":[{"line_number":648,"context_line":"                action\u003dmessage_field.Action.BACKUP_CREATE,"},{"line_number":649,"context_line":"                resource_type\u003dmessage_field.Resource.VOLUME_BACKUP,"},{"line_number":650,"context_line":"                resource_uuid\u003dbackup.id,"},{"line_number":651,"context_line":"                exception\u003dex,"},{"line_number":652,"context_line":"                detail\u003dmessage_field.Detail.BACKUP_SCHEDULE_ERROR)"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa46dd39_aa62a497","line":651,"range":{"start_line":651,"start_character":16,"end_line":651,"end_character":29},"updated":"2021-08-26 20:07:57.000000000","message":"I suggest not passing the exception here.  ServiceNotFound can be raised in a bunch of other contexts (like volume migration), so I think you definitely want the detail you\u0027re passing to be used.\n\nI guess it doesn\u0027t hurt to pass the exception ... unless someone adds it to the mapping for a different context, and then we\u0027ll wind up with an incorrect message.  Also, not passing the exc makes your intent clear that you want the detail here to be used.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2510d8685011cb2ae87908b4aba7e63083d43a","unresolved":false,"context_lines":[{"line_number":648,"context_line":"                action\u003dmessage_field.Action.BACKUP_CREATE,"},{"line_number":649,"context_line":"                resource_type\u003dmessage_field.Resource.VOLUME_BACKUP,"},{"line_number":650,"context_line":"                resource_uuid\u003dbackup.id,"},{"line_number":651,"context_line":"                exception\u003dex,"},{"line_number":652,"context_line":"                detail\u003dmessage_field.Detail.BACKUP_SCHEDULE_ERROR)"}],"source_content_type":"text/x-python","patch_set":19,"id":"9fe58aea_0680e335","line":651,"range":{"start_line":651,"start_character":16,"end_line":651,"end_character":29},"in_reply_to":"fa46dd39_aa62a497","updated":"2021-08-27 10:10:55.000000000","message":"Done","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"}],"releasenotes/notes/backup-user-messages-5ee0c7ead3def8f9.yaml":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"4d83d1873876eae82b351abe5818c97beaa7bf2f","unresolved":true,"context_lines":[{"line_number":2,"context_line":"other:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Added user messages for backup operations that a user"},{"line_number":5,"context_line":"    can query through messages API for asynchronous failure"},{"line_number":6,"context_line":"    in operations like create, delete, restore."}],"source_content_type":"text/x-yaml","patch_set":19,"id":"253fe4b7_31a94381","line":6,"range":{"start_line":5,"start_character":22,"end_line":6,"end_character":47},"updated":"2021-08-26 20:07:57.000000000","message":"how about:\n\n  the `Messages API\n  \u003chttps://docs.openstack.org/api-ref/block-storage/v3/#messages-messages\u003e`_.\n  These allow users to retrieve error messages for asynchronous failures\n  in backup operations like create, delete, and restore.","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2510d8685011cb2ae87908b4aba7e63083d43a","unresolved":false,"context_lines":[{"line_number":2,"context_line":"other:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Added user messages for backup operations that a user"},{"line_number":5,"context_line":"    can query through messages API for asynchronous failure"},{"line_number":6,"context_line":"    in operations like create, delete, restore."}],"source_content_type":"text/x-yaml","patch_set":19,"id":"18989219_b1b6b1f9","line":6,"range":{"start_line":5,"start_character":22,"end_line":6,"end_character":47},"in_reply_to":"253fe4b7_31a94381","updated":"2021-08-27 10:10:55.000000000","message":"Done","commit_id":"9d0b67d579261b677b8b4c4dcbae580bdc18385d"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"7fca325aeec0807a923685ff2fa39d3c9a57e229","unresolved":true,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Added user messages for backup operations that a user"},{"line_number":5,"context_line":"    can query through the `Messages API"},{"line_number":6,"context_line":"    \u003chttps://docs.openstack.org/api-ref/block-storage/v3/#messages-messages\u003e`_."},{"line_number":7,"context_line":"    These allow users to retrieve error messages for asynchronous"},{"line_number":8,"context_line":"    failures in backup operations like create, delete, and restore."}],"source_content_type":"text/x-yaml","patch_set":20,"id":"d3bee650_4dffe581","line":6,"range":{"start_line":6,"start_character":3,"end_line":6,"end_character":77},"updated":"2021-08-30 09:00:16.000000000","message":"?: I think it may be more useful to link the cinderclient commands [1] rather than the API (or maybe both).\n\n[1]: https://docs.openstack.org/python-cinderclient/latest/cli/details.html#cinder-message-delete","commit_id":"3b7f49986257c8e747a02b090a09c9deb8d577a5"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"ef586509fada6b579da44aa9e487c34d22aed0bf","unresolved":true,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Added user messages for backup operations that a user"},{"line_number":5,"context_line":"    can query through the `Messages API"},{"line_number":6,"context_line":"    \u003chttps://docs.openstack.org/api-ref/block-storage/v3/#messages-messages\u003e`_."},{"line_number":7,"context_line":"    These allow users to retrieve error messages for asynchronous"},{"line_number":8,"context_line":"    failures in backup operations like create, delete, and restore."}],"source_content_type":"text/x-yaml","patch_set":20,"id":"2e6d86ca_39559e00","line":6,"range":{"start_line":6,"start_character":3,"end_line":6,"end_character":77},"in_reply_to":"d3bee650_4dffe581","updated":"2021-09-02 19:04:39.000000000","message":"That\u0027s not a bad idea.  I\u0027d be in favor of both. The api-ref link says what the Messages API is, and the cinderclient link tells you how to see them.\n\nIf there are no more changes, you can do it as a follow up (as long as you get it done before the stable/xena branch is cut).","commit_id":"3b7f49986257c8e747a02b090a09c9deb8d577a5"}]}
