)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8d73283ca18bffe895a494aab414633995d993fd","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This patch adds support for specifying availability-zone"},{"line_number":10,"context_line":"and volume-type when restoring backup to a new volume."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"The two params are supported since microversion 3.63."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I68ef48375766e261772bc6964ece0a5efaf4a06d"},{"line_number":15,"context_line":"Implements: blueprint availabilityzone-and-volumetype-for-backup-restore"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"3f65232a_030218b5","line":12,"updated":"2020-10-21 10:15:21.000000000","message":"I\u0027m not sure how I feel about this feature now that we can do it through the \"cinder create\" flow.\n\nWe can currently do it if we use:\n\n  cinder --os-volume-api-version 3.47 create --volume-type \u003cvol-type\u003e --availability-zone \u003caz\u003e \u003csize\u003e\n\nSo adding this new API makes it possible that we can have a bug in one of the flows and not the other...\n\nI was discussing with Alan Bishop the possibility of adding the   command to the client, so when we use the right microversion we can use volume-type and availability-zone parameters and it\u0027s the client that changes the API endpoint it uses.  So for earlier versions we go through the backup API, and for newer versions we go through the create volume API.","commit_id":"d9f0bda7f90a78284e7de34e1e9aa1f911acc2c0"}],"cinder/api/contrib/backups.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8d73283ca18bffe895a494aab414633995d993fd","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        az \u003d restore.get(\u0027availability_zone\u0027, None)"},{"line_number":218,"context_line":"        volume_type \u003d restore.get(\u0027volume_type\u0027, None)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        if volume_id and any((az, volume_type)):"},{"line_number":221,"context_line":"            msg \u003d (\"availability_zone and volume_type are not supported \""},{"line_number":222,"context_line":"                   \"when restoring to an existing volume.\")"},{"line_number":223,"context_line":"            raise exc.HTTPBadRequest(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f65232a_63e14cff","line":220,"range":{"start_line":220,"start_character":25,"end_line":220,"end_character":48},"updated":"2020-10-21 10:15:21.000000000","message":"nit: I think for two elements it\u0027s \"cheaper\" to just do:\n\n  if volume_id and (az or volume_type):\n\nThe proposed code generates a tuple and then iterates throught it for just 2 items.","commit_id":"d9f0bda7f90a78284e7de34e1e9aa1f911acc2c0"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"caeff632be715479758f1cae6d924bb22dd4985d","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        volume_type \u003d restore.get(\u0027volume_type\u0027, None)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        if volume_id and any((az, volume_type)):"},{"line_number":221,"context_line":"            msg \u003d (\"availability_zone and volume_type are not supported \""},{"line_number":222,"context_line":"                   \"when restoring to an existing volume.\")"},{"line_number":223,"context_line":"            raise exc.HTTPBadRequest(msg)"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        LOG.info(\"Restoring backup %(backup_id)s to volume %(volume_id)s.\","},{"line_number":226,"context_line":"                 {\u0027backup_id\u0027: id, \u0027volume_id\u0027: volume_id},"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f65232a_e3727c11","line":223,"range":{"start_line":221,"start_character":0,"end_line":223,"end_character":41},"updated":"2020-10-21 10:21:39.000000000","message":"Maybe we should compare if the volume type and AZ already match the ones from the volume, and only fail if they don\u0027t match.","commit_id":"d9f0bda7f90a78284e7de34e1e9aa1f911acc2c0"}],"cinder/api/schemas/backups.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8d73283ca18bffe895a494aab414633995d993fd","unresolved":false,"context_lines":[{"line_number":95,"context_line":"}"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"restore_backup_v363 \u003d copy.deepcopy(restore)"},{"line_number":98,"context_line":"restore_backup_v363[\u0027properties\u0027][\u0027restore\u0027][\u0027properties\u0027]["},{"line_number":99,"context_line":"    \u0027availability_zone\u0027] \u003d parameter_types.nullable_string"},{"line_number":100,"context_line":"restore_backup_v363[\u0027properties\u0027][\u0027restore\u0027][\u0027properties\u0027]["},{"line_number":101,"context_line":"    \u0027volume_type\u0027] \u003d parameter_types.name_allow_zero_min_length"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"import_record \u003d {"},{"line_number":104,"context_line":"    \u0027type\u0027: \u0027object\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f65232a_8383c804","line":101,"range":{"start_line":98,"start_character":0,"end_line":101,"end_character":63},"updated":"2020-10-21 10:15:21.000000000","message":"nit: I think it\u0027s slightly more readable as:\n\n  restore_backup_v363[\u0027properties\u0027][\u0027restore\u0027][\u0027properties\u0027].update(\n      availability_zone\u003dparameter_types.nullable_string, \n      volume_type\u003dparameter_types.name_allow_zero_min_length)","commit_id":"d9f0bda7f90a78284e7de34e1e9aa1f911acc2c0"}],"cinder/backup/api.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8d73283ca18bffe895a494aab414633995d993fd","unresolved":false,"context_lines":[{"line_number":355,"context_line":"            if name is None:"},{"line_number":356,"context_line":"                name \u003d \u0027restore_backup_%s\u0027 % backup_id"},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"            if availability_zone:"},{"line_number":359,"context_line":"                try:"},{"line_number":360,"context_line":"                    self._get_available_backup_service_host("},{"line_number":361,"context_line":"                        None, availability_zone)"},{"line_number":362,"context_line":"                except exception.ServiceNotFound:"},{"line_number":363,"context_line":"                    msg \u003d _(\u0027Backup service is not available in \u0027"},{"line_number":364,"context_line":"                            \u0027availability zone: %s.\u0027) % availability_zone"},{"line_number":365,"context_line":"                    LOG.error(msg)"},{"line_number":366,"context_line":"                    raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"            if volume_type:"},{"line_number":369,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f65232a_8398e86a","line":366,"range":{"start_line":358,"start_character":0,"end_line":366,"end_character":60},"updated":"2020-10-21 10:15:21.000000000","message":"-1: Backup service can do cross AZ restores and backups, so we should not be limiting it here now.","commit_id":"d9f0bda7f90a78284e7de34e1e9aa1f911acc2c0"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8d73283ca18bffe895a494aab414633995d993fd","unresolved":false,"context_lines":[{"line_number":368,"context_line":"            if volume_type:"},{"line_number":369,"context_line":"                try:"},{"line_number":370,"context_line":"                    volume_type \u003d volume_types.get_by_name_or_id("},{"line_number":371,"context_line":"                        context.elevated(), volume_type)"},{"line_number":372,"context_line":"                except exception.InvalidVolumeType:"},{"line_number":373,"context_line":"                    msg \u003d _(\u0027Invalid volume_type passed: %s.\u0027) % volume_type"},{"line_number":374,"context_line":"                    LOG.error(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f65232a_639dcc58","line":371,"range":{"start_line":371,"start_character":24,"end_line":371,"end_character":42},"updated":"2020-10-21 10:15:21.000000000","message":"-1: We cannot pass an elevated context, or we may get volume types that the user is not allowed to use.","commit_id":"d9f0bda7f90a78284e7de34e1e9aa1f911acc2c0"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8d73283ca18bffe895a494aab414633995d993fd","unresolved":false,"context_lines":[{"line_number":369,"context_line":"                try:"},{"line_number":370,"context_line":"                    volume_type \u003d volume_types.get_by_name_or_id("},{"line_number":371,"context_line":"                        context.elevated(), volume_type)"},{"line_number":372,"context_line":"                except exception.InvalidVolumeType:"},{"line_number":373,"context_line":"                    msg \u003d _(\u0027Invalid volume_type passed: %s.\u0027) % volume_type"},{"line_number":374,"context_line":"                    LOG.error(msg)"},{"line_number":375,"context_line":"                    raise exception.InvalidInput(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f65232a_83b108e5","line":372,"range":{"start_line":372,"start_character":33,"end_line":372,"end_character":50},"updated":"2020-10-21 10:15:21.000000000","message":"-1: What about VolumeTypeNotFound?  We don\u0027t want to raise a 404 error, we should raise InvalidInput as well.","commit_id":"d9f0bda7f90a78284e7de34e1e9aa1f911acc2c0"}],"cinder/tests/unit/api/contrib/test_backups.py":[{"author":{"_account_id":32171,"name":"Girish Chilukuri","email":"girish.chilukuri@ibm.com","username":"GirishChilukuri"},"change_message_id":"fe7cbe8f78165a90b5e5521c3a621db6f96a19c3","unresolved":false,"context_lines":[{"line_number":1657,"context_line":""},{"line_number":1658,"context_line":"    @mock.patch(\u0027cinder.db.service_get_all\u0027)"},{"line_number":1659,"context_line":"    @mock.patch(\u0027cinder.backup.api.API.restore\u0027)"},{"line_number":1660,"context_line":"    def test_restore_backup_availability_zone_invalid("},{"line_number":1661,"context_line":"            self, _mock_volume_api_restore, _mock_service_get_all):"},{"line_number":1662,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":1663,"context_line":"        _mock_volume_api_restore.side_effect \u003d \\"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f6b1bfe_3935b5db","line":1660,"updated":"2020-10-14 14:46:09.000000000","message":"\"test_restore_backup_availability_zone_invalid\" and \"test_restore_backup_volume_type_invalid\" unit tests has repeated code and can be optimized using ddt.","commit_id":"46a0e2add614b13907f1659d5582a4478b47bb77"},{"author":{"_account_id":21797,"name":"Jeremy Liu","display_name":"Jeremy Liu","email":"liujiong.cc@gmail.com","username":"liujiong"},"change_message_id":"0a345312862adee29cec23742db93b5103df997e","unresolved":false,"context_lines":[{"line_number":1657,"context_line":""},{"line_number":1658,"context_line":"    @mock.patch(\u0027cinder.db.service_get_all\u0027)"},{"line_number":1659,"context_line":"    @mock.patch(\u0027cinder.backup.api.API.restore\u0027)"},{"line_number":1660,"context_line":"    def test_restore_backup_availability_zone_invalid("},{"line_number":1661,"context_line":"            self, _mock_volume_api_restore, _mock_service_get_all):"},{"line_number":1662,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":1663,"context_line":"        _mock_volume_api_restore.side_effect \u003d \\"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f6b1bfe_ba352dfa","line":1660,"in_reply_to":"7f6b1bfe_3935b5db","updated":"2020-10-15 01:52:15.000000000","message":"Done","commit_id":"46a0e2add614b13907f1659d5582a4478b47bb77"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"b2f0b6ae7a48d7a6763c41ef1d7509b435f0cc78","unresolved":false,"context_lines":[{"line_number":1600,"context_line":"            availability_zone\u003dNone,"},{"line_number":1601,"context_line":"            volume_type\u003dNone)"},{"line_number":1602,"context_line":""},{"line_number":1603,"context_line":"        self.assertEqual(http_client.ACCEPTED, res.status_int)"},{"line_number":1604,"context_line":"        self.assertEqual(backup.id, res_dict[\u0027restore\u0027][\u0027backup_id\u0027])"},{"line_number":1605,"context_line":""},{"line_number":1606,"context_line":"    @mock.patch(\u0027cinder.db.service_get_all\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f6b1bfe_00894e22","line":1603,"updated":"2020-10-15 04:45:54.000000000","message":"pep8: F821 undefined name \u0027http_client\u0027","commit_id":"a81c7139cda15bfbbf8280e7be573c79e6f4e7cf"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"b2f0b6ae7a48d7a6763c41ef1d7509b435f0cc78","unresolved":false,"context_lines":[{"line_number":1651,"context_line":"            availability_zone\u003d\u0027az1\u0027,"},{"line_number":1652,"context_line":"            volume_type\u003dNone)"},{"line_number":1653,"context_line":""},{"line_number":1654,"context_line":"        self.assertEqual(http_client.ACCEPTED, res.status_int)"},{"line_number":1655,"context_line":"        self.assertEqual(backup.id, res_dict[\u0027restore\u0027][\u0027backup_id\u0027])"},{"line_number":1656,"context_line":""},{"line_number":1657,"context_line":"    @ddt.data({\"restore\": {\"availability_zone\": \"az2\"}},"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f6b1bfe_607da21b","line":1654,"updated":"2020-10-15 04:45:54.000000000","message":"pep8: F821 undefined name \u0027http_client\u0027","commit_id":"a81c7139cda15bfbbf8280e7be573c79e6f4e7cf"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"b2f0b6ae7a48d7a6763c41ef1d7509b435f0cc78","unresolved":false,"context_lines":[{"line_number":1685,"context_line":"            fake_auth_context\u003dself.user_context))"},{"line_number":1686,"context_line":"        res_dict \u003d jsonutils.loads(res.body)"},{"line_number":1687,"context_line":""},{"line_number":1688,"context_line":"        self.assertEqual(http_client.BAD_REQUEST, res.status_int)"},{"line_number":1689,"context_line":"        self.assertEqual(http_client.BAD_REQUEST,"},{"line_number":1690,"context_line":"                         res_dict[\u0027badRequest\u0027][\u0027code\u0027])"},{"line_number":1691,"context_line":"        self.assertEqual(\u0027Invalid input received: Invalid input\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f6b1bfe_407a2624","line":1688,"updated":"2020-10-15 04:45:54.000000000","message":"pep8: F821 undefined name \u0027http_client\u0027","commit_id":"a81c7139cda15bfbbf8280e7be573c79e6f4e7cf"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"b2f0b6ae7a48d7a6763c41ef1d7509b435f0cc78","unresolved":false,"context_lines":[{"line_number":1686,"context_line":"        res_dict \u003d jsonutils.loads(res.body)"},{"line_number":1687,"context_line":""},{"line_number":1688,"context_line":"        self.assertEqual(http_client.BAD_REQUEST, res.status_int)"},{"line_number":1689,"context_line":"        self.assertEqual(http_client.BAD_REQUEST,"},{"line_number":1690,"context_line":"                         res_dict[\u0027badRequest\u0027][\u0027code\u0027])"},{"line_number":1691,"context_line":"        self.assertEqual(\u0027Invalid input received: Invalid input\u0027,"},{"line_number":1692,"context_line":"                         res_dict[\u0027badRequest\u0027][\u0027message\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f6b1bfe_a077ba3a","line":1689,"updated":"2020-10-15 04:45:54.000000000","message":"pep8: F821 undefined name \u0027http_client\u0027","commit_id":"a81c7139cda15bfbbf8280e7be573c79e6f4e7cf"}]}
