)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"ec5f61a7eb2af96eff7f7592df0460756f5dd39f","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Check snapshots when restoring backup"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"As snapshot is dependent on volume, when changing data"},{"line_number":10,"context_line":"of a volume, we need to check whether there are snapshots"},{"line_number":11,"context_line":"dependent with the volume."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I1a74e4b17494a693cd184a387649bf4559e4592c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a740942_04b223e5","line":10,"updated":"2015-12-09 00:40:39.000000000","message":"I\u0027m not sure I follow this.  \n\nWhat do you mean when changing data of a volume?","commit_id":"6978da0368ea88ea611878c38aa765f02dfa338f"}],"cinder/backup/api.py":[{"author":{"_account_id":10439,"name":"Xi Yang","email":"yang.xi@99cloud.net","username":"phenom"},"change_message_id":"37223e8b5765dd518acffbf0660b56c88a232dc7","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        snapshots \u003d objects.SnapshotList.get_all_for_volume(context,"},{"line_number":309,"context_line":"                                                            volume_id)"},{"line_number":310,"context_line":"        if len(snapshots):"},{"line_number":311,"context_line":"            LOG.info(_LI(\u0027Unable to restore volume %s, \u0027"},{"line_number":312,"context_line":"                         \u0027as currently it has snapshots.\u0027), volume_id)"},{"line_number":313,"context_line":"            msg \u003d _(\"Volume %(volume)s still has %(num)d dependent \""},{"line_number":314,"context_line":"                    \"snapshots.\") % {\u0027volume\u0027: volume_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_c2aa4b19","line":311,"updated":"2015-12-02 01:43:41.000000000","message":"I think it\u0027s better to log a warning or an error message here.","commit_id":"c3427887a42ed60174b8003272d5d68c1cc9e383"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"c79b5fc9d53b9e21cdc9e7809c90a51b1ef02e80","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        snapshots \u003d objects.SnapshotList.get_all_for_volume(context,"},{"line_number":309,"context_line":"                                                            volume_id)"},{"line_number":310,"context_line":"        if len(snapshots):"},{"line_number":311,"context_line":"            LOG.info(_LI(\u0027Unable to restore volume %s, \u0027"},{"line_number":312,"context_line":"                         \u0027as currently it has snapshots.\u0027), volume_id)"},{"line_number":313,"context_line":"            msg \u003d _(\"Volume %(volume)s still has %(num)d dependent \""},{"line_number":314,"context_line":"                    \"snapshots.\") % {\u0027volume\u0027: volume_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_2270aaa3","line":311,"in_reply_to":"9a8ffd7b_c2aa4b19","updated":"2015-12-03 06:00:27.000000000","message":"I log it as error.","commit_id":"c3427887a42ed60174b8003272d5d68c1cc9e383"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"6bd4af5f2f365f9d5078d0f6295fc836e4f4c93a","unresolved":false,"context_lines":[{"line_number":313,"context_line":"            msg \u003d _(\"Volume %(volume)s still has %(num)d dependent \""},{"line_number":314,"context_line":"                    \"snapshots.\") % {\u0027volume\u0027: volume_id,"},{"line_number":315,"context_line":"                                     \u0027num\u0027: len(snapshots)}"},{"line_number":316,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        LOG.info(_LI(\"Overwriting volume %(volume_id)s with restore of \""},{"line_number":319,"context_line":"                     \"backup %(backup_id)s\"),"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_6715dae3","line":316,"updated":"2015-12-01 12:43:40.000000000","message":"I think it makes sense to move your code so that it doesn\u0027t run in the case of a newly created volume, which of course won\u0027t have any snapshots.","commit_id":"c3427887a42ed60174b8003272d5d68c1cc9e383"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"c79b5fc9d53b9e21cdc9e7809c90a51b1ef02e80","unresolved":false,"context_lines":[{"line_number":313,"context_line":"            msg \u003d _(\"Volume %(volume)s still has %(num)d dependent \""},{"line_number":314,"context_line":"                    \"snapshots.\") % {\u0027volume\u0027: volume_id,"},{"line_number":315,"context_line":"                                     \u0027num\u0027: len(snapshots)}"},{"line_number":316,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        LOG.info(_LI(\"Overwriting volume %(volume_id)s with restore of \""},{"line_number":319,"context_line":"                     \"backup %(backup_id)s\"),"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_825f160e","line":316,"in_reply_to":"9a8ffd7b_6715dae3","updated":"2015-12-03 06:00:27.000000000","message":"Hi Tom, I put it here as I think it is better to check status at first.\n\nAnd refer to size and status, also no need to check for new volume. But they did. This is not wrong, but for safe. As a result I put snapshot check here.","commit_id":"c3427887a42ed60174b8003272d5d68c1cc9e383"}],"cinder/tests/unit/api/contrib/test_backups.py":[{"author":{"_account_id":10439,"name":"Xi Yang","email":"yang.xi@99cloud.net","username":"phenom"},"change_message_id":"37223e8b5765dd518acffbf0660b56c88a232dc7","unresolved":false,"context_lines":[{"line_number":1280,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":1281,"context_line":""},{"line_number":1282,"context_line":"        self.assertEqual(400, res.status_int)"},{"line_number":1283,"context_line":"        self.assertEqual(400, res_dict[\u0027badRequest\u0027][\u0027code\u0027])"},{"line_number":1284,"context_line":""},{"line_number":1285,"context_line":"        db.snapshot_destroy(context.get_admin_context(), snapshot_id)"},{"line_number":1286,"context_line":"        db.volume_destroy(context.get_admin_context(), volume_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_0514dd41","line":1283,"updated":"2015-12-02 01:43:41.000000000","message":"Better to assert the error message.","commit_id":"c3427887a42ed60174b8003272d5d68c1cc9e383"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"c79b5fc9d53b9e21cdc9e7809c90a51b1ef02e80","unresolved":false,"context_lines":[{"line_number":1280,"context_line":"        res_dict \u003d json.loads(res.body)"},{"line_number":1281,"context_line":""},{"line_number":1282,"context_line":"        self.assertEqual(400, res.status_int)"},{"line_number":1283,"context_line":"        self.assertEqual(400, res_dict[\u0027badRequest\u0027][\u0027code\u0027])"},{"line_number":1284,"context_line":""},{"line_number":1285,"context_line":"        db.snapshot_destroy(context.get_admin_context(), snapshot_id)"},{"line_number":1286,"context_line":"        db.volume_destroy(context.get_admin_context(), volume_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_16592735","line":1283,"in_reply_to":"9a8ffd7b_0514dd41","updated":"2015-12-03 06:00:27.000000000","message":"done","commit_id":"c3427887a42ed60174b8003272d5d68c1cc9e383"}]}
