)]}'
{"cinder/backup/api.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"7fc823af21f6e150161f729d0b7252de884d9046","unresolved":false,"context_lines":[{"line_number":366,"context_line":"                                                   \u0027restoring-backup\u0027})"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        self.backup_rpcapi.restore_backup(context, volume_host, backup,"},{"line_number":369,"context_line":"                                          volume_id)"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"        d \u003d {\u0027backup_id\u0027: backup_id,"},{"line_number":372,"context_line":"             \u0027volume_id\u0027: volume_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_25cd14b7","line":369,"updated":"2015-12-29 13:06:16.000000000","message":"You should send also whole volume object here. This will require change is backup.rpcapi also.","commit_id":"75db9daddeaf3399ae86064464aa0aa9f27c3c1b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"dd26c2102708ed0dafb1f7876950ad8c5d3c0813","unresolved":false,"context_lines":[{"line_number":362,"context_line":"        backup.status \u003d \u0027restoring\u0027"},{"line_number":363,"context_line":"        backup.save()"},{"line_number":364,"context_line":"        volume_host \u003d volume_utils.extract_host(volume.host, \u0027host\u0027)"},{"line_number":365,"context_line":"        self.db.volume_update(context, volume_id, {\u0027status\u0027:"},{"line_number":366,"context_line":"                                                   \u0027restoring-backup\u0027})"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        self.backup_rpcapi.restore_backup(context, volume_host, backup,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_b3a90ae2","line":365,"updated":"2015-12-29 17:11:42.000000000","message":"And this is why the patch is failing tempest - please use:\n\n volume.status \u003d \u0027restoring-backup\u0027\n volume.save()\n\nhere.","commit_id":"0506b2d7b62760b14c27140cbf4d90b53a2d1afd"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"73bc8ce69e3dd27114fd9bacea1bfaa343744125","unresolved":false,"context_lines":[{"line_number":335,"context_line":"            volume_id \u003d volume.id"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"            while True:"},{"line_number":338,"context_line":"                volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":339,"context_line":"                if volume.status !\u003d \u0027creating\u0027:"},{"line_number":340,"context_line":"                    break"},{"line_number":341,"context_line":"                greenthread.sleep(1)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_83d21fff","line":338,"updated":"2016-01-21 19:40:10.000000000","message":"You should use volume.refresh here.","commit_id":"3504adcb831c1389468aef439e2aaf76d0a8ebbf"}],"cinder/backup/manager.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"7fc823af21f6e150161f729d0b7252de884d9046","unresolved":false,"context_lines":[{"line_number":425,"context_line":"        LOG.info(_LI(\u0027Create backup finished. backup: %s.\u0027), backup.id)"},{"line_number":426,"context_line":"        self._notify_about_backup_usage(context, backup, \"create.end\")"},{"line_number":427,"context_line":""},{"line_number":428,"context_line":"    def restore_backup(self, context, backup, volume_id, volume\u003dNone):"},{"line_number":429,"context_line":"        \"\"\"Restore volume backups from configured backup service.\"\"\""},{"line_number":430,"context_line":"        LOG.info(_LI(\u0027Restore backup started, backup: %(backup_id)s \u0027"},{"line_number":431,"context_line":"                     \u0027volume: %(volume_id)s.\u0027),"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_a58b4467","line":428,"updated":"2015-12-29 13:06:16.000000000","message":"You\u0027ve added a new parameter but haven\u0027t changed backup.rpcapi. This will not be used.","commit_id":"75db9daddeaf3399ae86064464aa0aa9f27c3c1b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"7fc823af21f6e150161f729d0b7252de884d9046","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        LOG.info(_LI(\u0027Restore backup started, backup: %(backup_id)s \u0027"},{"line_number":431,"context_line":"                     \u0027volume: %(volume_id)s.\u0027),"},{"line_number":432,"context_line":"                 {\u0027backup_id\u0027: backup.id, \u0027volume_id\u0027: volume_id})"},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"        if volume is None:"},{"line_number":435,"context_line":"                volume \u003d objects.Volume.get_by_id(context, volume_id)"},{"line_number":436,"context_line":"        volume_host \u003d volume_utils.extract_host(volume.host, \u0027backend\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_85496862","line":433,"updated":"2015-12-29 13:06:16.000000000","message":"Please add FIXME comment that we can remove this with 2.0 version of RCP API.","commit_id":"75db9daddeaf3399ae86064464aa0aa9f27c3c1b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0fdb3e622b56b8c53fdcfe8744e01af4c04ee4a1","unresolved":false,"context_lines":[{"line_number":77,"context_line":"class BackupManager(manager.SchedulerDependentManager):"},{"line_number":78,"context_line":"    \"\"\"Manages backup of block storage devices.\"\"\""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    RPC_API_VERSION \u003d \u00271.2\u0027"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    target \u003d messaging.Target(version\u003dRPC_API_VERSION)"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_ad8769d6","line":80,"updated":"2015-12-29 16:30:13.000000000","message":"Interesting, this isn\u0027t matching the version on backup.rpcapi… But that\u0027s in the past, we should bump rpcapi version to 1.2 anyway.","commit_id":"0506b2d7b62760b14c27140cbf4d90b53a2d1afd"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0fdb3e622b56b8c53fdcfe8744e01af4c04ee4a1","unresolved":false,"context_lines":[{"line_number":442,"context_line":"        backup.host \u003d self.host"},{"line_number":443,"context_line":"        backup.save()"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        # import pdb; pdb.set_trace()"},{"line_number":446,"context_line":"        expected_status \u003d \u0027restoring-backup\u0027"},{"line_number":447,"context_line":"        actual_status \u003d volume.status"},{"line_number":448,"context_line":"        if actual_status !\u003d expected_status:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_4d3fcd25","line":445,"updated":"2015-12-29 16:30:13.000000000","message":"I bet this is leftover from debugging.","commit_id":"0506b2d7b62760b14c27140cbf4d90b53a2d1afd"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4e68cace95fb505e925885888ef7a0601e5d830d","unresolved":false,"context_lines":[{"line_number":433,"context_line":""},{"line_number":434,"context_line":"        # FIXME(sborkows): Remove this in v2.0 of RPC API"},{"line_number":435,"context_line":"        if volume is None:"},{"line_number":436,"context_line":"                volume \u003d objects.Volume.get_by_id(context, volume_id)"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        volume_host \u003d volume_utils.extract_host(volume.host, \u0027backend\u0027)"},{"line_number":439,"context_line":"        backend \u003d self._get_volume_backend(host\u003dvolume_host)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_52de0f12","line":436,"range":{"start_line":436,"start_character":8,"end_line":436,"end_character":17},"updated":"2016-01-04 20:43:37.000000000","message":"It\u0027s funny that PEP8 check haven\u0027t noticed this line. It is indented too much. That\u0027s just a non-blocking nit tough.","commit_id":"9c35e1856e6412ccd2f7dae2fc6b82910f9cc3b0"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"73bc8ce69e3dd27114fd9bacea1bfaa343744125","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                         \u0027size: %(backup_size)d, continuing with restore.\u0027),"},{"line_number":475,"context_line":"                     {\u0027vol_id\u0027: volume.id,"},{"line_number":476,"context_line":"                      \u0027vol_size\u0027: volume.size,"},{"line_number":477,"context_line":"                      \u0027backup_id\u0027: backup[\u0027id\u0027],"},{"line_number":478,"context_line":"                      \u0027backup_size\u0027: backup[\u0027size\u0027]})"},{"line_number":479,"context_line":""},{"line_number":480,"context_line":"        backup_service \u003d self._map_service_to_driver(backup[\u0027service\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_b9b0b0de","line":477,"updated":"2016-01-21 19:40:10.000000000","message":"You can use the dot notation for backup here - backup.id, backup.size.","commit_id":"3504adcb831c1389468aef439e2aaf76d0a8ebbf"}],"cinder/backup/rpcapi.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0fdb3e622b56b8c53fdcfe8744e01af4c04ee4a1","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    BASE_RPC_API_VERSION \u003d \u00271.0\u0027"},{"line_number":44,"context_line":"    RPC_API_VERSION \u003d \u00271.1\u0027"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def __init__(self):"},{"line_number":47,"context_line":"        super(BackupAPI, self).__init__()"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_8de625e7","line":44,"updated":"2015-12-29 16:30:13.000000000","message":"You\u0027ve missed RPC API version bump. We also need compatibility code similar as in other patches.","commit_id":"0506b2d7b62760b14c27140cbf4d90b53a2d1afd"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0fdb3e622b56b8c53fdcfe8744e01af4c04ee4a1","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        cctxt \u003d self.client.prepare(server\u003dbackup.host)"},{"line_number":57,"context_line":"        cctxt.cast(ctxt, \u0027create_backup\u0027, backup\u003dbackup)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def restore_backup(self, ctxt, volume_host, backup, volume_id,"},{"line_number":60,"context_line":"                       volume\u003dNone):"},{"line_number":61,"context_line":"        LOG.debug(\"restore_backup in rpcapi backup_id %s\", backup.id)"},{"line_number":62,"context_line":"        cctxt \u003d self.client.prepare(server\u003dvolume_host)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_cd03bd75","line":59,"range":{"start_line":59,"start_character":56,"end_line":59,"end_character":65},"updated":"2015-12-29 16:30:13.000000000","message":"As we\u0027re passing volume into this method we don\u0027t need volume_id here now. We can just use volume.id here.","commit_id":"0506b2d7b62760b14c27140cbf4d90b53a2d1afd"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"a6a2df206bcc03be1ef30845d9f371a6a3ff6487","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def restore_backup(self, ctxt, volume_host, backup, volume):"},{"line_number":62,"context_line":"        LOG.debug(\"restore_backup in rpcapi backup_id %s\", backup.id)"},{"line_number":63,"context_line":"        cctxt \u003d self.client.prepare(server\u003dvolume_host)"},{"line_number":64,"context_line":"        cctxt.cast(ctxt, \u0027restore_backup\u0027, backup\u003dbackup,"},{"line_number":65,"context_line":"                   volume_id\u003dvolume.id, volume\u003dvolume)"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_241295b5","line":63,"updated":"2015-12-30 14:36:45.000000000","message":"Please also add backward compatibility layer here, similar to for example [1].\n\n[1] https://github.com/openstack/cinder/blob/master/cinder/volume/rpcapi.py#L151-L155","commit_id":"f4b97c2686417ae91aaf3546d4b90a1ea42b0750"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4e68cace95fb505e925885888ef7a0601e5d830d","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        1.0 - Initial version."},{"line_number":40,"context_line":"        1.1 - Changed methods to accept backup objects instead of IDs."},{"line_number":41,"context_line":"        1.2 - Changed restore_backup method to be able to accept the volume"},{"line_number":42,"context_line":"              object as a parameter instead of volume_id."},{"line_number":43,"context_line":"    \"\"\""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_d26e7f2e","line":41,"range":{"start_line":41,"start_character":58,"end_line":41,"end_character":64},"updated":"2016-01-04 20:43:37.000000000","message":"It\u0027s more like \"send\" than \"accept\". Please fix if you\u0027ll be forced to do another patchset because of a merge conflict.\n\n(And you probably will if backup status enum patch will pass gate check ;))","commit_id":"9c35e1856e6412ccd2f7dae2fc6b82910f9cc3b0"}],"cinder/tests/unit/backup/test_rpcapi.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"a6a2df206bcc03be1ef30845d9f371a6a3ff6487","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                              server\u003dself.fake_backup_obj.host,"},{"line_number":93,"context_line":"                              backup\u003dself.fake_backup_obj)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def test_restore_backup(self):"},{"line_number":96,"context_line":"        self._test_backup_api(\u0027restore_backup\u0027,"},{"line_number":97,"context_line":"                              rpc_method\u003d\u0027cast\u0027,"},{"line_number":98,"context_line":"                              server\u003d\u0027fake_volume_host\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_c46a991a","line":95,"updated":"2015-12-30 14:36:45.000000000","message":"Once you\u0027ll add compatibility layer to rpcapi you will need to also add a new test here which will check it. An example of such tests pair is in [1]\n\n[1] https://github.com/openstack/cinder/blob/master/cinder/tests/unit/test_volume_rpcapi.py#L232-L258","commit_id":"f4b97c2686417ae91aaf3546d4b90a1ea42b0750"}],"cinder/tests/unit/test_backup.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"7fc823af21f6e150161f729d0b7252de884d9046","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from cinder import exception"},{"line_number":31,"context_line":"from cinder import objects"},{"line_number":32,"context_line":"from cinder import test"},{"line_number":33,"context_line":"from cinder.tests.unit import fake_volume"},{"line_number":34,"context_line":"from cinder.tests.unit.backup import fake_service_with_verify as fake_service"},{"line_number":35,"context_line":"from cinder.volume.drivers import lvm"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_454f006b","line":33,"updated":"2015-12-29 13:06:16.000000000","message":"PEP8 is failing because these imports aren\u0027t in alphabetical order. This line should be placed where 34th line is now.","commit_id":"75db9daddeaf3399ae86064464aa0aa9f27c3c1b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"7fc823af21f6e150161f729d0b7252de884d9046","unresolved":false,"context_lines":[{"line_number":641,"context_line":"        backup \u003d db.backup_get(self.ctxt, backup.id)"},{"line_number":642,"context_line":"        self.assertEqual(\u0027available\u0027, backup[\u0027status\u0027])"},{"line_number":643,"context_line":""},{"line_number":644,"context_line":"    @mock.patch(\u0027cinder.objects.volume.Volume.get_by_id\u0027)"},{"line_number":645,"context_line":"    @mock.patch(\u0027%s.%s\u0027 % (CONF.volume_driver, \u0027restore_backup\u0027))"},{"line_number":646,"context_line":"    def test_restore_backup(self, _mock_volume_restore, volume_get_by_id):"},{"line_number":647,"context_line":"        \"\"\"Test normal backup restoration.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_0524985d","line":644,"updated":"2015-12-29 13:06:16.000000000","message":"Any specific reason this needs to be added? It seems that before your work this was adding backup entries directly to SQLite DB that\u0027s present when running unit tests. I think you don\u0027t need to add this.","commit_id":"75db9daddeaf3399ae86064464aa0aa9f27c3c1b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4e68cace95fb505e925885888ef7a0601e5d830d","unresolved":false,"context_lines":[{"line_number":651,"context_line":""},{"line_number":652,"context_line":"        vol \u003d objects.Volume.get_by_id(self.ctxt, vol_id)"},{"line_number":653,"context_line":"        self.backup_mgr.restore_backup(self.ctxt, backup, vol_id, vol)"},{"line_number":654,"context_line":"        self.assertEqual(\u0027available\u0027, vol[\u0027status\u0027])"},{"line_number":655,"context_line":"        backup \u003d db.backup_get(self.ctxt, backup.id)"},{"line_number":656,"context_line":"        self.assertEqual(\u0027available\u0027, backup[\u0027status\u0027])"},{"line_number":657,"context_line":"        self.assertTrue(_mock_volume_restore.called)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_32ba7b6f","line":654,"range":{"start_line":654,"start_character":0,"end_line":654,"end_character":52},"updated":"2016-01-04 20:43:37.000000000","message":"To make this assert actually check the status *after* executing restore_backup you need to get it from the DB again. I think you can use vol.refresh() for that.","commit_id":"9c35e1856e6412ccd2f7dae2fc6b82910f9cc3b0"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"a2bd557d6c93ce7a691478bac2effe0a24ebadd7","unresolved":false,"context_lines":[{"line_number":657,"context_line":"        vol \u003d objects.Volume.get_by_id(self.ctxt, vol_id)"},{"line_number":658,"context_line":"        self.backup_mgr.restore_backup(self.ctxt, backup, vol_id, vol)"},{"line_number":659,"context_line":"        vol.refresh()"},{"line_number":660,"context_line":"        self.assertEqual(\u0027available\u0027, vol[\u0027status\u0027])"},{"line_number":661,"context_line":"        backup \u003d db.backup_get(self.ctxt, backup.id)"},{"line_number":662,"context_line":"        self.assertEqual(fields.BackupStatus.AVAILABLE, backup[\u0027status\u0027])"},{"line_number":663,"context_line":"        self.assertTrue(_mock_volume_restore.called)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba63e191_2a9c7bbf","line":660,"updated":"2016-01-19 17:46:09.000000000","message":"Could use dot notation here - vol.status","commit_id":"51f1e1e4e6512ca70a273bc0e7aa87498446185a"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"a2bd557d6c93ce7a691478bac2effe0a24ebadd7","unresolved":false,"context_lines":[{"line_number":658,"context_line":"        self.backup_mgr.restore_backup(self.ctxt, backup, vol_id, vol)"},{"line_number":659,"context_line":"        vol.refresh()"},{"line_number":660,"context_line":"        self.assertEqual(\u0027available\u0027, vol[\u0027status\u0027])"},{"line_number":661,"context_line":"        backup \u003d db.backup_get(self.ctxt, backup.id)"},{"line_number":662,"context_line":"        self.assertEqual(fields.BackupStatus.AVAILABLE, backup[\u0027status\u0027])"},{"line_number":663,"context_line":"        self.assertTrue(_mock_volume_restore.called)"},{"line_number":664,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba63e191_4a868f66","line":661,"updated":"2016-01-19 17:46:09.000000000","message":"You can use backup.refresh(), since _create_backup_db_entry returns a backup object.","commit_id":"51f1e1e4e6512ca70a273bc0e7aa87498446185a"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"a2bd557d6c93ce7a691478bac2effe0a24ebadd7","unresolved":false,"context_lines":[{"line_number":659,"context_line":"        vol.refresh()"},{"line_number":660,"context_line":"        self.assertEqual(\u0027available\u0027, vol[\u0027status\u0027])"},{"line_number":661,"context_line":"        backup \u003d db.backup_get(self.ctxt, backup.id)"},{"line_number":662,"context_line":"        self.assertEqual(fields.BackupStatus.AVAILABLE, backup[\u0027status\u0027])"},{"line_number":663,"context_line":"        self.assertTrue(_mock_volume_restore.called)"},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"    @mock.patch(\u0027cinder.volume.utils.notify_about_backup_usage\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba63e191_6a911399","line":662,"updated":"2016-01-19 17:46:09.000000000","message":"backup.status","commit_id":"51f1e1e4e6512ca70a273bc0e7aa87498446185a"}]}
