)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d06e8fb8c4b3e95f6a8692fbb3cfae39052eb939","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Update create_snapshot to use volume object"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The create_snapshot API is now able to use volume versioned objects."},{"line_number":10,"context_line":"It is still compatible with older RPC clients. Changes in the drivers"},{"line_number":11,"context_line":"are left to each driver maintainer to update."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Note that this patch DOES NOT try to use object dot notation everywhere"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a7b0d38_8aa03e92","line":10,"updated":"2015-12-22 18:43:14.000000000","message":"It seems that volume isn\u0027t passed to driver\u0027s create_snapshot, so there will be no changes in the drivers needed.","commit_id":"ef88b6219aa125bf36f1d00ad69ef5248ccae49c"}],"cinder/tests/unit/api/v1/test_snapshot_metadata.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"86577916a29e37ebcfb7eef3b002a0de307f539c","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        self.volume_api \u003d cinder.volume.api.API()"},{"line_number":123,"context_line":"        self.stubs.Set(volume.API, \u0027get\u0027, stub_get)"},{"line_number":124,"context_line":"        self.stubs.Set(cinder.db, \u0027snapshot_get\u0027, return_snapshot)"},{"line_number":125,"context_line":"        self.stubs.Set(cinder.db, \u0027snapshot_create\u0027, return_fake_snapshot)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        self.stubs.Set(self.volume_api, \u0027update_snapshot_metadata\u0027,"},{"line_number":128,"context_line":"                       fake_update_snapshot_metadata)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_ed92c49e","line":125,"range":{"start_line":125,"start_character":0,"end_line":125,"end_character":74},"updated":"2016-01-04 20:53:27.000000000","message":"You shouldn\u0027t add new usages of mox. Please update to use mock library instead. You can simply add a mock in setUp and clean it up in tearDown.\n\nI\u0027m not sure if mocking whole db.snapshot_create was intended here though…","commit_id":"829c1b469c198a342c86a61b0839285ec56b9b08"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"4f72027685d6a532b3bdcdcbe761b9559647b064","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            \u0027metadata\u0027: {}}"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def return_fake_snapshot(context, snapshot_id):"},{"line_number":93,"context_line":"    return fake_snapshot.fake_db_snapshot()"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a68dd71_d9a2444b","line":92,"updated":"2016-01-21 19:46:13.000000000","message":"Is this function used anywhere?  I am not seeing it.","commit_id":"dae73164e2df1e513f20aebc8dbdf5c0b798387c"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"4f72027685d6a532b3bdcdcbe761b9559647b064","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def return_fake_snapshot(context, snapshot_id):"},{"line_number":93,"context_line":"    return fake_snapshot.fake_db_snapshot()"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def stub_get(context, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a68dd71_b95af081","line":93,"updated":"2016-01-21 19:46:13.000000000","message":"Since you passed in the snapshot_id above, you should update the fake_db_snapshot with the id.","commit_id":"dae73164e2df1e513f20aebc8dbdf5c0b798387c"}],"cinder/tests/unit/api/v2/test_snapshot_metadata.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"86577916a29e37ebcfb7eef3b002a0de307f539c","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        self.stubs.Set(self.volume_api, \u0027update_snapshot_metadata\u0027,"},{"line_number":128,"context_line":"                       fake_update_snapshot_metadata)"},{"line_number":129,"context_line":"        self.stubs.Set(cinder.db, \u0027snapshot_create\u0027, return_fake_snapshot)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        self.ext_mgr \u003d extensions.ExtensionManager()"},{"line_number":132,"context_line":"        self.ext_mgr.extensions \u003d {}"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_2dce9cb4","line":129,"range":{"start_line":129,"start_character":0,"end_line":129,"end_character":74},"updated":"2016-01-04 20:53:27.000000000","message":"Same comment on mox usage.","commit_id":"829c1b469c198a342c86a61b0839285ec56b9b08"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"4f72027685d6a532b3bdcdcbe761b9559647b064","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def return_fake_snapshot(context, snapshot_id):"},{"line_number":93,"context_line":"    return fake_snapshot.fake_db_snapshot()"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def stub_get(context, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a68dd71_f9c70810","line":93,"updated":"2016-01-21 19:46:13.000000000","message":"Ditto","commit_id":"dae73164e2df1e513f20aebc8dbdf5c0b798387c"}],"cinder/tests/unit/test_volume_rpcapi.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d06e8fb8c4b3e95f6a8692fbb3cfae39052eb939","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                              version\u003d\u00271.15\u0027)"},{"line_number":292,"context_line":"        can_send_version.assert_called_once_with(\u00271.33\u0027)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    @mock.patch(\u0027oslo_messaging.RPCClient.can_send_version\u0027, return_value\u003dTrue)"},{"line_number":295,"context_line":"    def test_create_snapshot(self, can_send_version):"},{"line_number":296,"context_line":"        self._test_volume_api(\u0027create_snapshot\u0027,"},{"line_number":297,"context_line":"                              rpc_method\u003d\u0027cast\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_ea030275","line":294,"updated":"2015-12-22 18:43:14.000000000","message":"Please add a test where can_send_version will return False. Similarly like test above - test_delete_volume_old.","commit_id":"ef88b6219aa125bf36f1d00ad69ef5248ccae49c"}],"cinder/volume/api.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d06e8fb8c4b3e95f6a8692fbb3cfae39052eb939","unresolved":false,"context_lines":[{"line_number":734,"context_line":""},{"line_number":735,"context_line":"        return snapshot"},{"line_number":736,"context_line":""},{"line_number":737,"context_line":"    def create_snapshot_in_db(self, context,"},{"line_number":738,"context_line":"                              volume, name, description,"},{"line_number":739,"context_line":"                              force, metadata,"},{"line_number":740,"context_line":"                              cgsnapshot_id):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_4dc59059","line":737,"updated":"2015-12-22 18:43:14.000000000","message":"This is also used in manage_existing_snapshot, but seems safe to change, as an object is passed there.","commit_id":"ef88b6219aa125bf36f1d00ad69ef5248ccae49c"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d06e8fb8c4b3e95f6a8692fbb3cfae39052eb939","unresolved":false,"context_lines":[{"line_number":869,"context_line":""},{"line_number":870,"context_line":"        return snapshot_list"},{"line_number":871,"context_line":""},{"line_number":872,"context_line":"    def _create_snapshot_in_db_validate(self, context, volume, force):"},{"line_number":873,"context_line":"        check_policy(context, \u0027create_snapshot\u0027, volume)"},{"line_number":874,"context_line":""},{"line_number":875,"context_line":"        if volume.status \u003d\u003d \u0027maintenance\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_4d48305c","line":872,"updated":"2015-12-22 18:43:14.000000000","message":"If you\u0027ll follow the flow you can notice that this is only used in create_snapshots_in_db. And it is only used when creating in cinder.consistencygroup.api.create_cgsnapshot. And there we actually use DB API to fetch volumes instead of volume object. This means that method isn\u0027t related to create_snapshot and you shouldn\u0027t change it in this patch.","commit_id":"ef88b6219aa125bf36f1d00ad69ef5248ccae49c"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d06e8fb8c4b3e95f6a8692fbb3cfae39052eb939","unresolved":false,"context_lines":[{"line_number":890,"context_line":"                                          \u0027vol_status\u0027: volume.status}"},{"line_number":891,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":"    def _create_snapshots_in_db_reserve(self, context, volume_list):"},{"line_number":894,"context_line":"        reserve_opts_list \u003d []"},{"line_number":895,"context_line":"        total_reserve_opts \u003d {}"},{"line_number":896,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_ed2b1c32","line":893,"range":{"start_line":893,"start_character":8,"end_line":893,"end_character":39},"updated":"2015-12-22 18:43:14.000000000","message":"Same for this method.","commit_id":"ef88b6219aa125bf36f1d00ad69ef5248ccae49c"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d06e8fb8c4b3e95f6a8692fbb3cfae39052eb939","unresolved":false,"context_lines":[{"line_number":922,"context_line":""},{"line_number":923,"context_line":"        return reservations"},{"line_number":924,"context_line":""},{"line_number":925,"context_line":"    def _create_snapshot_in_db_options(self, context, volume,"},{"line_number":926,"context_line":"                                       name, description,"},{"line_number":927,"context_line":"                                       cgsnapshot_id):"},{"line_number":928,"context_line":"        options \u003d {\u0027volume_id\u0027: volume.id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_0dd8e852","line":925,"range":{"start_line":925,"start_character":8,"end_line":925,"end_character":38},"updated":"2015-12-22 18:43:14.000000000","message":"And same for this one.","commit_id":"ef88b6219aa125bf36f1d00ad69ef5248ccae49c"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"56d994603859ae731a97d1c025b31aea0cd42190","unresolved":false,"context_lines":[{"line_number":808,"context_line":"        snapshot \u003d None"},{"line_number":809,"context_line":"        try:"},{"line_number":810,"context_line":"            kwargs \u003d {"},{"line_number":811,"context_line":"                \u0027volume_id\u0027: volume.id,"},{"line_number":812,"context_line":"                \u0027cgsnapshot_id\u0027: cgsnapshot_id,"},{"line_number":813,"context_line":"                \u0027user_id\u0027: context.user_id,"},{"line_number":814,"context_line":"                \u0027project_id\u0027: context.project_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_41cbf853","line":811,"range":{"start_line":811,"start_character":29,"end_line":811,"end_character":35},"updated":"2015-12-23 14:06:11.000000000","message":"You have the volume object at this point, so you could set it as the snapshot.volume attribute.  That way, it does not have to be lazy-loaded later, and you can access it from the snapshot object instead of sending it as a kwarg.","commit_id":"e85de08e662f3246565d63d6ec49f26cb73fc1f6"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"a6e6e85c7f7b6499221e6d7d4826f533b975030f","unresolved":false,"context_lines":[{"line_number":799,"context_line":"        try:"},{"line_number":800,"context_line":"            kwargs \u003d {"},{"line_number":801,"context_line":"                \u0027volume_id\u0027: volume.id,"},{"line_number":802,"context_line":"                \u0027cgsnapshot_id\u0027: cgsnapshot_id,"},{"line_number":803,"context_line":"                \u0027user_id\u0027: context.user_id,"},{"line_number":804,"context_line":"                \u0027project_id\u0027: context.project_id,"},{"line_number":805,"context_line":"                \u0027status\u0027: \u0027creating\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a7b0d38_7fe97be5","line":802,"updated":"2015-12-28 17:22:13.000000000","message":"Any reason why you are not setting the volume attribute here?\n\n\u0027volume\u0027: volume,\n\nIf not, it will trigger a lazy-load of the volume in manager.py.","commit_id":"1eb56fd94db2819f161dccb87022e5fd7baa9e82"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"d6410ec30eea1a4b2d0281233a7410f4220ba0a4","unresolved":false,"context_lines":[{"line_number":799,"context_line":"        try:"},{"line_number":800,"context_line":"            kwargs \u003d {"},{"line_number":801,"context_line":"                \u0027volume_id\u0027: volume.id,"},{"line_number":802,"context_line":"                \u0027cgsnapshot_id\u0027: cgsnapshot_id,"},{"line_number":803,"context_line":"                \u0027user_id\u0027: context.user_id,"},{"line_number":804,"context_line":"                \u0027project_id\u0027: context.project_id,"},{"line_number":805,"context_line":"                \u0027status\u0027: \u0027creating\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a7b0d38_e8ea9373","line":802,"in_reply_to":"1a7b0d38_48c2c735","updated":"2015-12-28 20:32:11.000000000","message":"We should NOT put volume in expected attributes.  It would cause lots of extra DB calls when a single snapshot is loaded, hence it was not originally done.  You could set the volume after the snapshot is created and reset the obj_changes.\n\nsnapshot.volume \u003d volume\nsnapshot. obj_reset_changes()","commit_id":"1eb56fd94db2819f161dccb87022e5fd7baa9e82"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"b0876c0f61f1f440e34b2f198b35ad74de3cede5","unresolved":false,"context_lines":[{"line_number":799,"context_line":"        try:"},{"line_number":800,"context_line":"            kwargs \u003d {"},{"line_number":801,"context_line":"                \u0027volume_id\u0027: volume.id,"},{"line_number":802,"context_line":"                \u0027cgsnapshot_id\u0027: cgsnapshot_id,"},{"line_number":803,"context_line":"                \u0027user_id\u0027: context.user_id,"},{"line_number":804,"context_line":"                \u0027project_id\u0027: context.project_id,"},{"line_number":805,"context_line":"                \u0027status\u0027: \u0027creating\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a7b0d38_48c2c735","line":802,"in_reply_to":"1a7b0d38_7fe97be5","updated":"2015-12-28 20:18:52.000000000","message":"It\u0027s not possible to create a snapshot when volume is set, we raise exception in create then.\n\nBut we can add volume to DEFAULT_EXPECTED_ATTRS on snapshot as it is eager-loaded by default by DB API. This way we would not need to lazy-load it in manager.","commit_id":"1eb56fd94db2819f161dccb87022e5fd7baa9e82"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"41487d3573badd2579407559d2a4851d2f2cb45f","unresolved":false,"context_lines":[{"line_number":799,"context_line":"        try:"},{"line_number":800,"context_line":"            kwargs \u003d {"},{"line_number":801,"context_line":"                \u0027volume_id\u0027: volume.id,"},{"line_number":802,"context_line":"                \u0027cgsnapshot_id\u0027: cgsnapshot_id,"},{"line_number":803,"context_line":"                \u0027user_id\u0027: context.user_id,"},{"line_number":804,"context_line":"                \u0027project_id\u0027: context.project_id,"},{"line_number":805,"context_line":"                \u0027status\u0027: \u0027creating\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a7b0d38_608f8a2a","line":802,"in_reply_to":"1a7b0d38_e8ea9373","updated":"2015-12-29 13:58:44.000000000","message":"My mistake.  Michal is correct - volume is eager-loaded in the DB call and it would be available for the snapshot to convert to a volume object.  You just need to add volume to the tuple at https://github.com/openstack/cinder/blob/master/cinder/objects/snapshot.py#L40, and to expected_attrs at https://github.com/openstack/cinder/blob/master/cinder/objects/snapshot.py#L270","commit_id":"1eb56fd94db2819f161dccb87022e5fd7baa9e82"}],"cinder/volume/manager.py":[{"author":{"_account_id":14305,"name":"Yuriy Nesenenko","email":"ynesenenko@mirantis.com","username":"yuriy_n"},"change_message_id":"a873badbf7cdee8255f9163849b6a7d810cdd185","unresolved":false,"context_lines":[{"line_number":722,"context_line":"            volume_ref.status \u003d status"},{"line_number":723,"context_line":"            volume_ref.save()"},{"line_number":724,"context_line":""},{"line_number":725,"context_line":"    def create_snapshot(self, context, volume_id, snapshot, volume\u003dNone):"},{"line_number":726,"context_line":"        \"\"\"Creates and exports the snapshot.\"\"\""},{"line_number":727,"context_line":"        context \u003d context.elevated()"},{"line_number":728,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_24ffb6ab","line":725,"range":{"start_line":725,"start_character":71,"end_line":725,"end_character":73},"updated":"2015-12-24 13:20:17.000000000","message":"Agreed with Thang. No sense to pass volume object.","commit_id":"e85de08e662f3246565d63d6ec49f26cb73fc1f6"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"56d994603859ae731a97d1c025b31aea0cd42190","unresolved":false,"context_lines":[{"line_number":722,"context_line":"            volume_ref.status \u003d status"},{"line_number":723,"context_line":"            volume_ref.save()"},{"line_number":724,"context_line":""},{"line_number":725,"context_line":"    def create_snapshot(self, context, volume_id, snapshot, volume\u003dNone):"},{"line_number":726,"context_line":"        \"\"\"Creates and exports the snapshot.\"\"\""},{"line_number":727,"context_line":"        context \u003d context.elevated()"},{"line_number":728,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_41de986e","line":725,"range":{"start_line":725,"start_character":50,"end_line":725,"end_character":58},"updated":"2015-12-23 14:06:11.000000000","message":"snapshot has the volume attribute, i.e. snapshot.volume, which can be lazy-loaded.  It is not necessary to send the volume object and do the extra work of making it backwards compatible.","commit_id":"e85de08e662f3246565d63d6ec49f26cb73fc1f6"}],"cinder/volume/rpcapi.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"7e61055722e4a4316b273054ed261e7576ef6647","unresolved":false,"context_lines":[{"line_number":176,"context_line":"    def create_snapshot(self, ctxt, volume, snapshot):"},{"line_number":177,"context_line":"        new_host \u003d utils.extract_host(volume.host)"},{"line_number":178,"context_line":"        msg_args \u003d {"},{"line_number":179,"context_line":"            \u0027volume_id\u0027: volume.id, \u0027snapshot\u0027: snapshot, \u0027volume\u0027: volume,"},{"line_number":180,"context_line":"        }"},{"line_number":181,"context_line":"        version \u003d \u00271.38\u0027"},{"line_number":182,"context_line":"        if not self.client.can_send_version(version):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a7b0d38_2c4518b2","line":179,"updated":"2015-12-28 14:15:11.000000000","message":"Probably this \u0027volume\u0027 here is causing the tempest errors.","commit_id":"4ae82c6ce65d31ad6ec9e872f5ad80a90792835a"},{"author":{"_account_id":10439,"name":"Xi Yang","email":"yang.xi@99cloud.net","username":"phenom"},"change_message_id":"10d19d0813cdf03a77fd5e55813fa7e4d623db06","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        1.36 - Adds support for sending objects over RPC in migrate_volume(),"},{"line_number":87,"context_line":"               migrate_volume_completion(), and update_migrated_volume()."},{"line_number":88,"context_line":"        1.37 - Adds old_reservations parameter to retype to support quota"},{"line_number":89,"context_line":"               checks in the API."},{"line_number":90,"context_line":"    \"\"\""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    BASE_RPC_API_VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_d7ec23f5","line":89,"range":{"start_line":89,"start_character":15,"end_line":89,"end_character":21},"updated":"2016-01-05 03:11:44.000000000","message":"Do we need to add version 1.38 here?","commit_id":"829c1b469c198a342c86a61b0839285ec56b9b08"}]}
