)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"9658dce844387d4518c3608985afcbda095bdf43","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Tintri snapshot id"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Tinter driver to associate cinder snapshot id to tintri id and store in cinder snapshot metadata."},{"line_number":10,"context_line":"Cinder snapshot name and volume id are stored in tintri snapshot metadata."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Closes-Bug: #1468949"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba3cc151_f8766005","line":9,"updated":"2015-07-06 18:01:37.000000000","message":"Please wrap this to 72 chars wide.\n\nhttps://wiki.openstack.org/wiki/GitCommitMessages","commit_id":"b379be8ff7b1acbfcb93da74d91c22782baf981a"},{"author":{"_account_id":5149,"name":"Sean Chen","email":"xuchenx@gmail.com","username":"opencompute"},"change_message_id":"3ff2a47360f4f66365c846daaf9326f29072a6e7","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Tintri snapshot id"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Tinter driver to associate cinder snapshot id to tintri id and store in cinder snapshot metadata."},{"line_number":10,"context_line":"Cinder snapshot name and volume id are stored in tintri snapshot metadata."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Closes-Bug: #1468949"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba3cc151_6b083c29","line":9,"in_reply_to":"ba3cc151_f8766005","updated":"2015-07-06 18:08:29.000000000","message":"Done","commit_id":"b379be8ff7b1acbfcb93da74d91c22782baf981a"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"f410556d75b11aa9ee453a055659afd5391560bc","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Tintri snapshot id"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Tinter driver to associate cinder snapshot id to tintri id and"},{"line_number":10,"context_line":"store in cinder snapshot metadata."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Cinder snapshot name and volume id are stored in tintri snapshot metadata."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"ba3cc151_215ecce9","line":9,"updated":"2015-07-06 22:15:33.000000000","message":"s/Tinter/Tintri/?","commit_id":"d50bd73494ae6c49c533e032804118f3f3cedb6e"},{"author":{"_account_id":5149,"name":"Sean Chen","email":"xuchenx@gmail.com","username":"opencompute"},"change_message_id":"8652c728ff42a23db7eb4738e1b551fc9e4a570f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Tintri snapshot id"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Tinter driver to associate cinder snapshot id to tintri id and"},{"line_number":10,"context_line":"store in cinder snapshot metadata."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Cinder snapshot name and volume id are stored in tintri snapshot metadata."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"ba3cc151_42b66bdd","line":9,"in_reply_to":"ba3cc151_215ecce9","updated":"2015-07-07 02:26:34.000000000","message":"Done","commit_id":"d50bd73494ae6c49c533e032804118f3f3cedb6e"}],"cinder/tests/unit/test_tintri.py":[{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"1f151a9fd67dfa0f562a5f7d9663ec2142e9acca","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        snapshot \u003d fake_snapshot.fake_snapshot_obj(self.context)"},{"line_number":111,"context_line":"        volume \u003d fake_volume.fake_volume_obj(self.context)"},{"line_number":112,"context_line":"        snapshot.volume \u003d volume"},{"line_number":113,"context_line":"        with mock.patch(\u0027cinder.objects.snapshot.Snapshot.save\u0027):"},{"line_number":114,"context_line":"            self._driver.create_snapshot(snapshot)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @mock.patch.object(TClient, \u0027create_snapshot\u0027, mock.Mock("}],"source_content_type":"text/x-python","patch_set":7,"id":"9a41bdd9_cafbfb45","line":113,"updated":"2015-07-15 14:01:22.000000000","message":"You should verify the save was called and provider_id was correct.  There is no provider_id even in this test.","commit_id":"6a3964455104d1fa7f63f402904ab2262b10159b"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"1f151a9fd67dfa0f562a5f7d9663ec2142e9acca","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    def test_delete_snapshot(self):"},{"line_number":127,"context_line":"        snapshot \u003d fake_snapshot.fake_snapshot_obj(self.context)"},{"line_number":128,"context_line":"        snapshot.provider_id \u003d \u0027snapshot-id\u0027"},{"line_number":129,"context_line":"        self._driver.delete_snapshot(snapshot)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    @mock.patch.object(TClient, \u0027delete_snapshot\u0027, mock.Mock("},{"line_number":132,"context_line":"                       side_effect\u003dexception.VolumeDriverException))"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a41bdd9_8a665328","line":129,"updated":"2015-07-15 14:01:22.000000000","message":"This unit test does not do anything.  You should test if the provider_id is not set, it just logs, otherwise it would make a client call.","commit_id":"6a3964455104d1fa7f63f402904ab2262b10159b"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"ca7915be21ca66bbdf7368923dc71ee9318f83cb","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        volume \u003d fake_volume.fake_volume_obj(self.context)"},{"line_number":112,"context_line":"        snapshot.volume \u003d volume"},{"line_number":113,"context_line":"        with mock.patch(\u0027cinder.objects.snapshot.Snapshot.save\u0027):"},{"line_number":114,"context_line":"            self._driver.create_snapshot(snapshot)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @mock.patch.object(TClient, \u0027create_snapshot\u0027, mock.Mock("},{"line_number":117,"context_line":"                       side_effect\u003dexception.VolumeDriverException))"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_a494aa36","line":114,"updated":"2015-07-28 21:25:19.000000000","message":"http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises says \"A properly written test asserts that particular behavior occurs.\"  If the behavior is just that you were able to run create_snapshot without an exception being raised, assert that that method returns what you expect, even if that is an implicit None.   Often you can test that some critical submethod was called.","commit_id":"64d5c5fbca0b2d04b2dbbd83e3cb5265c13557e5"},{"author":{"_account_id":14377,"name":"Apoorva","email":"apps.desh@gmail.com","username":"apoorvad"},"change_message_id":"1eb73164695553ba88c8970b10e0630f3649b0a0","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        volume \u003d fake_volume.fake_volume_obj(self.context)"},{"line_number":112,"context_line":"        snapshot.volume \u003d volume"},{"line_number":113,"context_line":"        with mock.patch(\u0027cinder.objects.snapshot.Snapshot.save\u0027):"},{"line_number":114,"context_line":"            self._driver.create_snapshot(snapshot)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @mock.patch.object(TClient, \u0027create_snapshot\u0027, mock.Mock("},{"line_number":117,"context_line":"                       side_effect\u003dexception.VolumeDriverException))"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_842295b7","line":114,"in_reply_to":"3a50d1a3_97197ad3","updated":"2015-07-29 20:12:10.000000000","message":"Done","commit_id":"64d5c5fbca0b2d04b2dbbd83e3cb5265c13557e5"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"3d4dedf0146e5428ba604705497e55bbaa58ca8f","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        volume \u003d fake_volume.fake_volume_obj(self.context)"},{"line_number":112,"context_line":"        snapshot.volume \u003d volume"},{"line_number":113,"context_line":"        with mock.patch(\u0027cinder.objects.snapshot.Snapshot.save\u0027):"},{"line_number":114,"context_line":"            self._driver.create_snapshot(snapshot)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @mock.patch.object(TClient, \u0027create_snapshot\u0027, mock.Mock("},{"line_number":117,"context_line":"                       side_effect\u003dexception.VolumeDriverException))"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_97197ad3","line":114,"in_reply_to":"3a50d1a3_a494aa36","updated":"2015-07-29 14:08:38.000000000","message":"The same comment was raise when the Tintri driver was initially proposed - https://review.openstack.org/#/c/185148/11/cinder/tests/unit/test_tintri.py.  It was ignored :(","commit_id":"64d5c5fbca0b2d04b2dbbd83e3cb5265c13557e5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"ca7915be21ca66bbdf7368923dc71ee9318f83cb","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    def test_delete_snapshot(self):"},{"line_number":127,"context_line":"        snapshot \u003d fake_snapshot.fake_snapshot_obj(self.context)"},{"line_number":128,"context_line":"        snapshot.provider_id \u003d \u0027snapshot-id\u0027"},{"line_number":129,"context_line":"        self._driver.delete_snapshot(snapshot)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    @mock.patch.object(TClient, \u0027delete_snapshot\u0027, mock.Mock("},{"line_number":132,"context_line":"                       side_effect\u003dexception.VolumeDriverException))"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_e4bdd2b1","line":129,"updated":"2015-07-28 21:25:19.000000000","message":"ditto","commit_id":"64d5c5fbca0b2d04b2dbbd83e3cb5265c13557e5"},{"author":{"_account_id":14377,"name":"Apoorva","email":"apps.desh@gmail.com","username":"apoorvad"},"change_message_id":"1eb73164695553ba88c8970b10e0630f3649b0a0","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    def test_delete_snapshot(self):"},{"line_number":127,"context_line":"        snapshot \u003d fake_snapshot.fake_snapshot_obj(self.context)"},{"line_number":128,"context_line":"        snapshot.provider_id \u003d \u0027snapshot-id\u0027"},{"line_number":129,"context_line":"        self._driver.delete_snapshot(snapshot)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    @mock.patch.object(TClient, \u0027delete_snapshot\u0027, mock.Mock("},{"line_number":132,"context_line":"                       side_effect\u003dexception.VolumeDriverException))"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_242dc1a7","line":129,"in_reply_to":"3a50d1a3_e4bdd2b1","updated":"2015-07-29 20:12:10.000000000","message":"Done","commit_id":"64d5c5fbca0b2d04b2dbbd83e3cb5265c13557e5"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"617b22a1a0a3bce6b7d605e2caab7cc633cd5cea","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        provider_id \u003d \u002712345\u0027"},{"line_number":114,"context_line":"        snapshot.volume \u003d volume"},{"line_number":115,"context_line":"        with mock.patch(\u0027cinder.objects.snapshot.Snapshot.save\u0027):"},{"line_number":116,"context_line":"            self.assertEqual(None, self._driver.create_snapshot(snapshot))"},{"line_number":117,"context_line":"            self.assertEqual(provider_id, snapshot.provider_id)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    @mock.patch.object(TClient, \u0027create_snapshot\u0027, mock.Mock("}],"source_content_type":"text/x-python","patch_set":9,"id":"1a4dcd0f_46dc5674","line":116,"updated":"2015-08-14 15:05:14.000000000","message":"Use self.assertIsNone","commit_id":"7d734bd1acd4901963b81122e071b4212d7957bc"},{"author":{"_account_id":14377,"name":"Apoorva","email":"apps.desh@gmail.com","username":"apoorvad"},"change_message_id":"0de6cf8397e29bf6e1da5f3584c4ea49bbbda965","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        provider_id \u003d \u002712345\u0027"},{"line_number":114,"context_line":"        snapshot.volume \u003d volume"},{"line_number":115,"context_line":"        with mock.patch(\u0027cinder.objects.snapshot.Snapshot.save\u0027):"},{"line_number":116,"context_line":"            self.assertEqual(None, self._driver.create_snapshot(snapshot))"},{"line_number":117,"context_line":"            self.assertEqual(provider_id, snapshot.provider_id)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    @mock.patch.object(TClient, \u0027create_snapshot\u0027, mock.Mock("}],"source_content_type":"text/x-python","patch_set":9,"id":"1a4dcd0f_538f2c75","line":116,"in_reply_to":"1a4dcd0f_46dc5674","updated":"2015-08-14 18:07:30.000000000","message":"Done","commit_id":"7d734bd1acd4901963b81122e071b4212d7957bc"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"617b22a1a0a3bce6b7d605e2caab7cc633cd5cea","unresolved":false,"context_lines":[{"line_number":129,"context_line":"    def test_delete_snapshot(self):"},{"line_number":130,"context_line":"        snapshot \u003d fake_snapshot.fake_snapshot_obj(self.context)"},{"line_number":131,"context_line":"        snapshot.provider_id \u003d \u0027snapshot-id\u0027"},{"line_number":132,"context_line":"        self.assertEqual(None, self._driver.delete_snapshot(snapshot))"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    @mock.patch.object(TClient, \u0027delete_snapshot\u0027, mock.Mock("},{"line_number":135,"context_line":"                       side_effect\u003dexception.VolumeDriverException))"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a4dcd0f_a6443a1b","line":132,"updated":"2015-08-14 15:05:14.000000000","message":"Ditto","commit_id":"7d734bd1acd4901963b81122e071b4212d7957bc"},{"author":{"_account_id":14377,"name":"Apoorva","email":"apps.desh@gmail.com","username":"apoorvad"},"change_message_id":"0de6cf8397e29bf6e1da5f3584c4ea49bbbda965","unresolved":false,"context_lines":[{"line_number":129,"context_line":"    def test_delete_snapshot(self):"},{"line_number":130,"context_line":"        snapshot \u003d fake_snapshot.fake_snapshot_obj(self.context)"},{"line_number":131,"context_line":"        snapshot.provider_id \u003d \u0027snapshot-id\u0027"},{"line_number":132,"context_line":"        self.assertEqual(None, self._driver.delete_snapshot(snapshot))"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    @mock.patch.object(TClient, \u0027delete_snapshot\u0027, mock.Mock("},{"line_number":135,"context_line":"                       side_effect\u003dexception.VolumeDriverException))"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a4dcd0f_13e8c415","line":132,"in_reply_to":"1a4dcd0f_a6443a1b","updated":"2015-08-14 18:07:30.000000000","message":"Done","commit_id":"7d734bd1acd4901963b81122e071b4212d7957bc"}],"cinder/volume/drivers/tintri.py":[{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"f410556d75b11aa9ee453a055659afd5391560bc","unresolved":false,"context_lines":[{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def _get_volume(self, volume_id):"},{"line_number":115,"context_line":"        \"\"\"Returns volume for given volume ID.\"\"\""},{"line_number":116,"context_line":"        return self.db.volume_get(self._context, volume_id)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _get_provider_snapshot_id(self, snapshot_id):"},{"line_number":119,"context_line":"        \"\"\"Returns provider snapshot ID for given snapshot.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba3cc151_61f134cd","line":116,"updated":"2015-07-06 22:15:33.000000000","message":"You can indirectly get the volume of a snapshot by \"snapshot.volume\".  It will lazy-load the volume.  Accessing the database directly within a driver is not ideal.","commit_id":"d50bd73494ae6c49c533e032804118f3f3cedb6e"},{"author":{"_account_id":5149,"name":"Sean Chen","email":"xuchenx@gmail.com","username":"opencompute"},"change_message_id":"8652c728ff42a23db7eb4738e1b551fc9e4a570f","unresolved":false,"context_lines":[{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def _get_volume(self, volume_id):"},{"line_number":115,"context_line":"        \"\"\"Returns volume for given volume ID.\"\"\""},{"line_number":116,"context_line":"        return self.db.volume_get(self._context, volume_id)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _get_provider_snapshot_id(self, snapshot_id):"},{"line_number":119,"context_line":"        \"\"\"Returns provider snapshot ID for given snapshot.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba3cc151_c2ca7b4f","line":116,"in_reply_to":"ba3cc151_61f134cd","updated":"2015-07-07 02:26:34.000000000","message":"Done","commit_id":"d50bd73494ae6c49c533e032804118f3f3cedb6e"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"f410556d75b11aa9ee453a055659afd5391560bc","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _set_provider_snapshot_id(self, snapshot_id, provider_id):"},{"line_number":125,"context_line":"        \"\"\"Stores provider snapshot ID for given snapshot.\"\"\""},{"line_number":126,"context_line":"        self.db.snapshot_metadata_update(self._context, snapshot_id,"},{"line_number":127,"context_line":"                                         {tintri_id: provider_id}, False)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def delete_snapshot(self, snapshot):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba3cc151_611a9419","line":126,"updated":"2015-07-06 22:15:33.000000000","message":"This is very bad.  Drivers should not directly access the db.  Instead you should use the snapshot object to update the metadata, i.e. \nsnapshot.metadata.update({tintri_id: provider_id})\nsnapshot.save()","commit_id":"d50bd73494ae6c49c533e032804118f3f3cedb6e"},{"author":{"_account_id":5149,"name":"Sean Chen","email":"xuchenx@gmail.com","username":"opencompute"},"change_message_id":"8652c728ff42a23db7eb4738e1b551fc9e4a570f","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _set_provider_snapshot_id(self, snapshot_id, provider_id):"},{"line_number":125,"context_line":"        \"\"\"Stores provider snapshot ID for given snapshot.\"\"\""},{"line_number":126,"context_line":"        self.db.snapshot_metadata_update(self._context, snapshot_id,"},{"line_number":127,"context_line":"                                         {tintri_id: provider_id}, False)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def delete_snapshot(self, snapshot):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba3cc151_62e04fcd","line":126,"in_reply_to":"ba3cc151_611a9419","updated":"2015-07-07 02:26:34.000000000","message":"but snapshot.metadata is a MetaData object which doesn\u0027t support update/get.","commit_id":"d50bd73494ae6c49c533e032804118f3f3cedb6e"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"afd3b96ceb997a23e5abee3d5ca0c67645990f2a","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _set_provider_snapshot_id(self, snapshot_id, provider_id):"},{"line_number":125,"context_line":"        \"\"\"Stores provider snapshot ID for given snapshot.\"\"\""},{"line_number":126,"context_line":"        self.db.snapshot_metadata_update(self._context, snapshot_id,"},{"line_number":127,"context_line":"                                         {tintri_id: provider_id}, False)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def delete_snapshot(self, snapshot):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba3cc151_42bc2b6c","line":126,"in_reply_to":"ba3cc151_62e04fcd","updated":"2015-07-07 02:36:23.000000000","message":"snapshot.metadata is a dict.","commit_id":"d50bd73494ae6c49c533e032804118f3f3cedb6e"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"e8d2c0449ffafbe9287a5cc428614846e69601b1","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        metadata \u003d self.db.snapshot_metadata_get(self._context, snapshot_id)"},{"line_number":116,"context_line":"        return metadata.get(tintri_id)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _set_provider_snapshot_id(self, snapshot_id, provider_id):"},{"line_number":119,"context_line":"        \"\"\"Stores provider snapshot ID for given snapshot.\"\"\""},{"line_number":120,"context_line":"        self.db.snapshot_metadata_update(self._context, snapshot_id,"},{"line_number":121,"context_line":"                                         {tintri_id: provider_id}, False)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_a2a5f747","line":118,"updated":"2015-07-07 02:41:03.000000000","message":"See my comments in patch #2.\n\nmetadata \u003d snapshot.metadata\nmetadata.update({tintri_id: provider_id})\nsnapshot.metadata \u003d metadata \nsnapshot.save()","commit_id":"42651260ff53833f1f5d88c26505710aa0f6f6d2"},{"author":{"_account_id":5149,"name":"Sean Chen","email":"xuchenx@gmail.com","username":"opencompute"},"change_message_id":"bbc5ef654eefd0ead384b3de62bedb7eac06d64e","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        metadata \u003d self.db.snapshot_metadata_get(self._context, snapshot_id)"},{"line_number":116,"context_line":"        return metadata.get(tintri_id)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _set_provider_snapshot_id(self, snapshot_id, provider_id):"},{"line_number":119,"context_line":"        \"\"\"Stores provider snapshot ID for given snapshot.\"\"\""},{"line_number":120,"context_line":"        self.db.snapshot_metadata_update(self._context, snapshot_id,"},{"line_number":121,"context_line":"                                         {tintri_id: provider_id}, False)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_d546884e","line":118,"in_reply_to":"ba3cc151_a2a5f747","updated":"2015-07-07 18:57:10.000000000","message":"Liberty/Kilo have refactored snapshot object, I was going for a consistent implementation, I will change per your comment.","commit_id":"42651260ff53833f1f5d88c26505710aa0f6f6d2"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"45f4320bc6b5e60b1b2ad28451e9cdedcd2a9ffb","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def _get_provider_snapshot_id(self, snapshot):"},{"line_number":117,"context_line":"        \"\"\"Returns provider snapshot ID for given snapshot.\"\"\""},{"line_number":118,"context_line":"        return snapshot.metadata.get(tintri_id)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _set_provider_snapshot_id(self, snapshot, provider_id):"},{"line_number":121,"context_line":"        \"\"\"Stores provider snapshot ID for given snapshot.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"ba3cc151_b578767f","line":118,"updated":"2015-07-08 14:55:03.000000000","message":"There\u0027s a provider_id in the snapshots table. Can you use that to store tintri_id instead of using metatdata?","commit_id":"b0948c573e6aed20f5e254ca05f96e7e5ddc6b33"},{"author":{"_account_id":14377,"name":"Apoorva","email":"apps.desh@gmail.com","username":"apoorvad"},"change_message_id":"ed207b56cfb1051aa98c03bbcd1aa880f47f8de5","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    def delete_snapshot(self, snapshot):"},{"line_number":117,"context_line":"        \"\"\"Deletes a snapshot.\"\"\""},{"line_number":118,"context_line":"        with self._get_client() as c:"},{"line_number":119,"context_line":"            if snapshot.provider_id:"},{"line_number":120,"context_line":"                c.delete_snapshot(snapshot.provider_id)"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def _check_ops(self, required_ops, configuration):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a41bdd9_2df35475","line":119,"updated":"2015-07-12 05:42:10.000000000","message":"if not found then let\u0027s log it","commit_id":"ea4ac6d4ab4effa0bdaa069ce27e004df626c605"},{"author":{"_account_id":14377,"name":"Apoorva","email":"apps.desh@gmail.com","username":"apoorvad"},"change_message_id":"ed207b56cfb1051aa98c03bbcd1aa880f47f8de5","unresolved":false,"context_lines":[{"line_number":777,"context_line":"                             \u0027.dto.domain.beans.cinder.CinderSnapshotSpec\u0027,"},{"line_number":778,"context_line":"                   \u0027file\u0027: TClient._remove_prefix(volume_path, tintri_path),"},{"line_number":779,"context_line":"                   \u0027vmName\u0027: volume_name or snapshot_name,"},{"line_number":780,"context_line":"                   \u0027description\u0027: snapshot_name,"},{"line_number":781,"context_line":"                   \u0027vmTintriUuid\u0027: volume_id,"},{"line_number":782,"context_line":"                   \u0027instanceId\u0027: volume_id,"},{"line_number":783,"context_line":"                   \u0027snapshotCreator\u0027: \u0027Cinder\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a41bdd9_add8c4f0","line":780,"updated":"2015-07-12 05:42:10.000000000","message":"As discussed, please add description as -\nsnapshot_name + \" (\" + volume_id + \")\"","commit_id":"ea4ac6d4ab4effa0bdaa069ce27e004df626c605"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"4274b1df3d47d48f1429c2141322aa1f5e73f4e8","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            with self._get_client() as c:"},{"line_number":120,"context_line":"                c.delete_snapshot(snapshot.provider_id)"},{"line_number":121,"context_line":"        else:"},{"line_number":122,"context_line":"            LOG.info(_LI(\u0027Snapshot %s not found\u0027), snapshot.name)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _check_ops(self, required_ops, configuration):"},{"line_number":125,"context_line":"        \"\"\"Ensures that the options we care about are set.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a41bdd9_f04fce31","line":122,"updated":"2015-07-15 14:26:39.000000000","message":"Please, use ID instead of name","commit_id":"6a3964455104d1fa7f63f402904ab2262b10159b"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"96f71f5d28d66f3fbedf4f10d98ecd4754541805","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            with self._get_client() as c:"},{"line_number":120,"context_line":"                c.delete_snapshot(snapshot.provider_id)"},{"line_number":121,"context_line":"        else:"},{"line_number":122,"context_line":"            LOG.info(_LI(\u0027Snapshot %s not found\u0027), snapshot.name)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _check_ops(self, required_ops, configuration):"},{"line_number":125,"context_line":"        \"\"\"Ensures that the options we care about are set.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a41bdd9_a446e378","line":122,"in_reply_to":"9a41bdd9_04beaffe","updated":"2015-07-15 17:00:47.000000000","message":"Not really.  What if the snapshot has the same name as another snapshot, which can happen because names do not have to be unique.","commit_id":"6a3964455104d1fa7f63f402904ab2262b10159b"},{"author":{"_account_id":5149,"name":"Sean Chen","email":"xuchenx@gmail.com","username":"opencompute"},"change_message_id":"8dbc083d65239dd17e2d00598342815c9977abea","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            with self._get_client() as c:"},{"line_number":120,"context_line":"                c.delete_snapshot(snapshot.provider_id)"},{"line_number":121,"context_line":"        else:"},{"line_number":122,"context_line":"            LOG.info(_LI(\u0027Snapshot %s not found\u0027), snapshot.name)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _check_ops(self, required_ops, configuration):"},{"line_number":125,"context_line":"        \"\"\"Ensures that the options we care about are set.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a41bdd9_df188ed5","line":122,"in_reply_to":"9a41bdd9_a446e378","updated":"2015-07-15 17:11:25.000000000","message":"snapshot.name is different from snapshot.display_name.\nsnapshot.name is always unique.","commit_id":"6a3964455104d1fa7f63f402904ab2262b10159b"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"cda90184c1e904f7af42284419e480750d5724c4","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            with self._get_client() as c:"},{"line_number":120,"context_line":"                c.delete_snapshot(snapshot.provider_id)"},{"line_number":121,"context_line":"        else:"},{"line_number":122,"context_line":"            LOG.info(_LI(\u0027Snapshot %s not found\u0027), snapshot.name)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _check_ops(self, required_ops, configuration):"},{"line_number":125,"context_line":"        \"\"\"Ensures that the options we care about are set.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a41bdd9_7f9e2208","line":122,"in_reply_to":"9a41bdd9_df188ed5","updated":"2015-07-15 17:16:01.000000000","message":"Yes, my mistake.  But name has the snapshot.id in it - https://github.com/openstack/cinder/blob/master/cinder/objects/snapshot.py#L70.  So it is easier to read snapshot.id vs snapshot.name.","commit_id":"6a3964455104d1fa7f63f402904ab2262b10159b"},{"author":{"_account_id":5149,"name":"Sean Chen","email":"xuchenx@gmail.com","username":"opencompute"},"change_message_id":"8e0f70379cb4bdee6b167d11b387637f71c2665b","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            with self._get_client() as c:"},{"line_number":120,"context_line":"                c.delete_snapshot(snapshot.provider_id)"},{"line_number":121,"context_line":"        else:"},{"line_number":122,"context_line":"            LOG.info(_LI(\u0027Snapshot %s not found\u0027), snapshot.name)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _check_ops(self, required_ops, configuration):"},{"line_number":125,"context_line":"        \"\"\"Ensures that the options we care about are set.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a41bdd9_04beaffe","line":122,"in_reply_to":"9a41bdd9_f04fce31","updated":"2015-07-15 16:50:54.000000000","message":"logging name instead of id is better.","commit_id":"6a3964455104d1fa7f63f402904ab2262b10159b"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"d119ed9de61d5d729d9260c8addd9311094f4c83","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    def create_snapshot(self, snapshot):"},{"line_number":103,"context_line":"        \"\"\"Creates a snapshot.\"\"\""},{"line_number":104,"context_line":"        (__, path) \u003d self._get_export_ip_path(snapshot.volume_id)"},{"line_number":105,"context_line":"        volume_path \u003d \u0027%s/%s\u0027 % (path, snapshot.volume_name)"},{"line_number":106,"context_line":"        with self._get_client() as c:"},{"line_number":107,"context_line":"            provider_id \u003d c.create_snapshot(volume_path,"},{"line_number":108,"context_line":"                                            snapshot.volume.display_name or"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a4dcd0f_cd76353f","line":105,"updated":"2015-08-14 20:50:03.000000000","message":"Please use named interpolation.","commit_id":"2565d43e2a0efe5e633d478e33dc0ced0e4a263e"},{"author":{"_account_id":14377,"name":"Apoorva","email":"apps.desh@gmail.com","username":"apoorvad"},"change_message_id":"9cd4dfa738ae1fe17b97b08d94cad0bced84f219","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    def create_snapshot(self, snapshot):"},{"line_number":103,"context_line":"        \"\"\"Creates a snapshot.\"\"\""},{"line_number":104,"context_line":"        (__, path) \u003d self._get_export_ip_path(snapshot.volume_id)"},{"line_number":105,"context_line":"        volume_path \u003d \u0027%s/%s\u0027 % (path, snapshot.volume_name)"},{"line_number":106,"context_line":"        with self._get_client() as c:"},{"line_number":107,"context_line":"            provider_id \u003d c.create_snapshot(volume_path,"},{"line_number":108,"context_line":"                                            snapshot.volume.display_name or"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a4dcd0f_d53477e0","line":105,"in_reply_to":"1a4dcd0f_cd76353f","updated":"2015-08-14 23:42:38.000000000","message":"Done","commit_id":"2565d43e2a0efe5e633d478e33dc0ced0e4a263e"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"d119ed9de61d5d729d9260c8addd9311094f4c83","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                                            snapshot.display_name or"},{"line_number":112,"context_line":"                                            snapshot.name)"},{"line_number":113,"context_line":"            snapshot.provider_id \u003d provider_id"},{"line_number":114,"context_line":"            snapshot.save()"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def delete_snapshot(self, snapshot):"},{"line_number":117,"context_line":"        \"\"\"Deletes a snapshot.\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"1a4dcd0f_2d2a39e8","line":114,"updated":"2015-08-14 20:50:03.000000000","message":"You should not write to db in the driver.  Instead, you can return a dictionary to the manager and the manager will update db for you:\n\nhttps://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L660","commit_id":"2565d43e2a0efe5e633d478e33dc0ced0e4a263e"},{"author":{"_account_id":14377,"name":"Apoorva","email":"apps.desh@gmail.com","username":"apoorvad"},"change_message_id":"9cd4dfa738ae1fe17b97b08d94cad0bced84f219","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                                            snapshot.display_name or"},{"line_number":112,"context_line":"                                            snapshot.name)"},{"line_number":113,"context_line":"            snapshot.provider_id \u003d provider_id"},{"line_number":114,"context_line":"            snapshot.save()"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def delete_snapshot(self, snapshot):"},{"line_number":117,"context_line":"        \"\"\"Deletes a snapshot.\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"1a4dcd0f_753323f7","line":114,"in_reply_to":"1a4dcd0f_2d2a39e8","updated":"2015-08-14 23:42:38.000000000","message":"Done","commit_id":"2565d43e2a0efe5e633d478e33dc0ced0e4a263e"}]}
