)]}'
{"cinder/tests/unit/volume/drivers/test_pure.py":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"cc50493c4c20f8a145e3d868ea03e054b251acea","unresolved":true,"context_lines":[{"line_number":2208,"context_line":"                          snap, {\u0027name\u0027: PURE_SNAPSHOT[\u0027name\u0027]})"},{"line_number":2209,"context_line":""},{"line_number":2210,"context_line":"    def test_unmanage_snapshot(self):"},{"line_number":2211,"context_line":"        snap, snap_name \u003d self.new_fake_snap()"},{"line_number":2212,"context_line":"        if len(snap_name + UNMANAGED_SUFFIX) \u003e 63:"},{"line_number":2213,"context_line":"            unmanaged_snap_name \u003d snap_name[:-len(UNMANAGED_SUFFIX)] + \\"},{"line_number":2214,"context_line":"                UNMANAGED_SUFFIX"}],"source_content_type":"text/x-python","patch_set":10,"id":"d204a700_8f2d7f31","line":2211,"range":{"start_line":2211,"start_character":31,"end_line":2211,"end_character":44},"updated":"2021-02-19 22:05:44.000000000","message":"i think this is always going to give you the default fake snap name based on the default fake volume name which is based on the fake volume ID, so you\u0027ll get:\n\n  \u003e\u003e\u003e len(\u00271e5177e7-95e5-4a0f-b170-e45f4b469f6a\u0027)\n  36\n  \u003e\u003e\u003e len(\u0027volume-1e5177e7-95e5-4a0f-b170-e45f4b469f6a\u0027)\n  43\n  \u003e\u003e\u003e len(\u0027volume-1e5177e7-95e5-4a0f-b170-e45f4b469f6a-cinder\u0027)\n  50\n  \u003e\u003e\u003e len(\u0027volume-1e5177e7-95e5-4a0f-b170-e45f4b469f6a-cinder-unmanaged\u0027)\n  60\n\nwhich won\u0027t actually test the change introduced on this patch.  (I may be missing something, though).","commit_id":"34cf4167f3ee2619e6bca5531e1638a0efa8e8ca"},{"author":{"_account_id":13425,"name":"Simon Dodsley","email":"simon@purestorage.com","username":"sdodsley"},"change_message_id":"794433d47730ece2551e7a03b22c732deefe92cf","unresolved":false,"context_lines":[{"line_number":2208,"context_line":"                          snap, {\u0027name\u0027: PURE_SNAPSHOT[\u0027name\u0027]})"},{"line_number":2209,"context_line":""},{"line_number":2210,"context_line":"    def test_unmanage_snapshot(self):"},{"line_number":2211,"context_line":"        snap, snap_name \u003d self.new_fake_snap()"},{"line_number":2212,"context_line":"        if len(snap_name + UNMANAGED_SUFFIX) \u003e 63:"},{"line_number":2213,"context_line":"            unmanaged_snap_name \u003d snap_name[:-len(UNMANAGED_SUFFIX)] + \\"},{"line_number":2214,"context_line":"                UNMANAGED_SUFFIX"}],"source_content_type":"text/x-python","patch_set":10,"id":"df2b9591_db1c6efb","line":2211,"range":{"start_line":2211,"start_character":31,"end_line":2211,"end_character":44},"in_reply_to":"d204a700_8f2d7f31","updated":"2021-02-24 18:37:37.000000000","message":"Thanks for checking this - you made be realize that this test is for the snapshot unmanage and therefore the name we are checking is the snapshot name which is a concat of the vol and the snap in a specific layout, unique to the Pure backend.\nSo actually the size check in this case should not be 63, so changing it to the correct number of 96.\nIt would be something like:\n\n\u003e\u003e\u003e len(\u0027volume-1e5177e7-95e5-4a0f-b170-e45f4b469f6a-cinder.snapshot-253b2878-ec60-4793-ad19-e65496ec7aab\u0027)\n96\n\u003e\u003e len(\u0027volume-1e5177e7-95e5-4a0f-b170-e45f4b469f6a-cinder.snapshot-253b2878-ec60-4793-ad19-e65496ec7aab-unmanaged\u0027)\n106\n\u003e\u003e len(\"volume-1e5177e7-95e5-4a0f-b170-e45f4b469f6a-cinder.snapshot-253b2878-ec60-4793-ad19-e6-unmanaged\")\n96","commit_id":"34cf4167f3ee2619e6bca5531e1638a0efa8e8ca"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"cc50493c4c20f8a145e3d868ea03e054b251acea","unresolved":true,"context_lines":[{"line_number":2230,"context_line":"            unmanaged_snap_name \u003d snap_name[:-len(UNMANAGED_SUFFIX)] + \\"},{"line_number":2231,"context_line":"                UNMANAGED_SUFFIX"},{"line_number":2232,"context_line":"        else:"},{"line_number":2233,"context_line":"            unmanaged_snap_name \u003d snap_name"},{"line_number":2234,"context_line":"        self.array.rename_volume.side_effect \u003d \\"},{"line_number":2235,"context_line":"            self.purestorage_module.PureHTTPError("},{"line_number":2236,"context_line":"                text\u003d\"Snapshot does not exist.\","}],"source_content_type":"text/x-python","patch_set":10,"id":"b8390efa_3c19326b","line":2233,"updated":"2021-02-19 22:05:44.000000000","message":"same comment as line 2211","commit_id":"34cf4167f3ee2619e6bca5531e1638a0efa8e8ca"},{"author":{"_account_id":13425,"name":"Simon Dodsley","email":"simon@purestorage.com","username":"sdodsley"},"change_message_id":"794433d47730ece2551e7a03b22c732deefe92cf","unresolved":false,"context_lines":[{"line_number":2230,"context_line":"            unmanaged_snap_name \u003d snap_name[:-len(UNMANAGED_SUFFIX)] + \\"},{"line_number":2231,"context_line":"                UNMANAGED_SUFFIX"},{"line_number":2232,"context_line":"        else:"},{"line_number":2233,"context_line":"            unmanaged_snap_name \u003d snap_name"},{"line_number":2234,"context_line":"        self.array.rename_volume.side_effect \u003d \\"},{"line_number":2235,"context_line":"            self.purestorage_module.PureHTTPError("},{"line_number":2236,"context_line":"                text\u003d\"Snapshot does not exist.\","}],"source_content_type":"text/x-python","patch_set":10,"id":"f8be40ea_c488d8ad","line":2233,"in_reply_to":"b8390efa_3c19326b","updated":"2021-02-24 18:37:37.000000000","message":"Ack","commit_id":"34cf4167f3ee2619e6bca5531e1638a0efa8e8ca"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"bb436a5c8298598ffbd1d089ff8a5ee5737d73db","unresolved":true,"context_lines":[{"line_number":644,"context_line":"        return group_snap, group_snap_name"},{"line_number":645,"context_line":""},{"line_number":646,"context_line":""},{"line_number":647,"context_line":"@ddt.ddt"},{"line_number":648,"context_line":"class PureBaseVolumeDriverTestCase(PureBaseSharedDriverTestCase):"},{"line_number":649,"context_line":"    def _setup_mocks_for_replication(self):"},{"line_number":650,"context_line":"        # Mock config values"}],"source_content_type":"text/x-python","patch_set":12,"id":"8892ab8a_735fcfef","line":647,"updated":"2021-03-06 00:08:50.000000000","message":"if you make the change I suggest below, you\u0027ll want to change this to:\n\n  @ddt.ddt(testNameFormat\u003dddt.TestNameFormat.INDEX_ONLY)\n\n(otherwise ddt uses the data in generating the test name)","commit_id":"856b0ef6401b27299f6dae020101e70a7ba09e88"},{"author":{"_account_id":13425,"name":"Simon Dodsley","email":"simon@purestorage.com","username":"sdodsley"},"change_message_id":"e223a81348682123578e7cc8fdaa354c6bf841ec","unresolved":false,"context_lines":[{"line_number":644,"context_line":"        return group_snap, group_snap_name"},{"line_number":645,"context_line":""},{"line_number":646,"context_line":""},{"line_number":647,"context_line":"@ddt.ddt"},{"line_number":648,"context_line":"class PureBaseVolumeDriverTestCase(PureBaseSharedDriverTestCase):"},{"line_number":649,"context_line":"    def _setup_mocks_for_replication(self):"},{"line_number":650,"context_line":"        # Mock config values"}],"source_content_type":"text/x-python","patch_set":12,"id":"6ebb4a91_dcef97ec","line":647,"in_reply_to":"8892ab8a_735fcfef","updated":"2021-03-06 14:18:48.000000000","message":"Done","commit_id":"856b0ef6401b27299f6dae020101e70a7ba09e88"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"bb436a5c8298598ffbd1d089ff8a5ee5737d73db","unresolved":true,"context_lines":[{"line_number":2208,"context_line":"                          snap, {\u0027name\u0027: PURE_SNAPSHOT[\u0027name\u0027]})"},{"line_number":2209,"context_line":""},{"line_number":2210,"context_line":"    def test_unmanage_snapshot(self):"},{"line_number":2211,"context_line":"        snap, snap_name \u003d self.new_fake_snap()"},{"line_number":2212,"context_line":"        if len(snap_name + UNMANAGED_SUFFIX) \u003e 96:"},{"line_number":2213,"context_line":"            unmanaged_snap_name \u003d snap_name[:-len(UNMANAGED_SUFFIX)] + \\"},{"line_number":2214,"context_line":"                UNMANAGED_SUFFIX"},{"line_number":2215,"context_line":"        else:"},{"line_number":2216,"context_line":"            unmanaged_snap_name \u003d snap_name"},{"line_number":2217,"context_line":"        self.driver.unmanage_snapshot(snap)"},{"line_number":2218,"context_line":"        self.array.rename_volume.assert_called_with(snap_name,"},{"line_number":2219,"context_line":"                                                    unmanaged_snap_name)"},{"line_number":2220,"context_line":""},{"line_number":2221,"context_line":"    def test_unmanage_snapshot_error_propagates(self):"},{"line_number":2222,"context_line":"        snap, _ \u003d self.new_fake_snap()"},{"line_number":2223,"context_line":"        self.assert_error_propagates([self.array.rename_volume],"}],"source_content_type":"text/x-python","patch_set":12,"id":"fd4a32ee_32678509","line":2220,"range":{"start_line":2211,"start_character":0,"end_line":2220,"end_character":0},"updated":"2021-03-06 00:08:50.000000000","message":"hate to be a PITA, but this test is using the same code that sets the value, so if the function under test is actually incorrect, this test won\u0027t detect it.  The key things you\u0027re looking for are: (1) rename was called, (2) the new name doesn\u0027t exceed the length limit, and (3) the new name has the correct suffix.  So maybe something like this:\n\n        snap, snap_name \u003d self.new_fake_snap()\n        self.driver.unmanage_snapshot(snap)\n        self.array.rename_volume.assert_called_once()\n        old_name \u003d self.array.rename_volume.call_args[0][0]\n        new_name \u003d self.array.rename_volume.call_args[0][1]\n        self.assertEqual(old_name, snap_name)\n        self.assertLessEqual(len(new_name), 96)\n        self.assertTrue(new_name.endswith(UNMANAGED_SUFFIX))\n\nOK, now what\u0027s missing is that ideally you\u0027d test a short name and a long name.  So you can use ddt for that if you mock out the _get_snap_name function that\u0027s used by the code under test:\n\n    @ddt.data(\n        # 96 chars, will exceed allowable length\n        \u0027volume-1e5177e7-95e5-4a0f-b170-e45f4b469f6a-cinder.\u0027\n              \u0027snapshot-253b2878-ec60-4793-ad19-e65496ec7aab\u0027,\n        # short_name that will require no adjustment\n        \u0027volume-1e5177e7-cinder.snapshot-e65496ec7aab\u0027)\n    @mock.patch(BASE_DRIVER_OBJ + \"._get_snap_name\")\n    def test_unmanage_snapshot(self, fake_name, mock_get_snap_name):\n        snap, _ \u003d self.new_fake_snap()\n        mock_get_snap_name.return_value \u003d fake_name\n\n        self.driver.unmanage_snapshot(snap)\n        self.array.rename_volume.assert_called_once()\n        old_name \u003d self.array.rename_volume.call_args[0][0]\n        new_name \u003d self.array.rename_volume.call_args[0][1]\n        self.assertEqual(fake_name, old_name)\n        self.assertLessEqual(len(new_name), 96)\n        self.assertTrue(new_name.endswith(UNMANAGED_SUFFIX))\n\n(Also, see comment on line 647)","commit_id":"856b0ef6401b27299f6dae020101e70a7ba09e88"},{"author":{"_account_id":13425,"name":"Simon Dodsley","email":"simon@purestorage.com","username":"sdodsley"},"change_message_id":"e223a81348682123578e7cc8fdaa354c6bf841ec","unresolved":false,"context_lines":[{"line_number":2208,"context_line":"                          snap, {\u0027name\u0027: PURE_SNAPSHOT[\u0027name\u0027]})"},{"line_number":2209,"context_line":""},{"line_number":2210,"context_line":"    def test_unmanage_snapshot(self):"},{"line_number":2211,"context_line":"        snap, snap_name \u003d self.new_fake_snap()"},{"line_number":2212,"context_line":"        if len(snap_name + UNMANAGED_SUFFIX) \u003e 96:"},{"line_number":2213,"context_line":"            unmanaged_snap_name \u003d snap_name[:-len(UNMANAGED_SUFFIX)] + \\"},{"line_number":2214,"context_line":"                UNMANAGED_SUFFIX"},{"line_number":2215,"context_line":"        else:"},{"line_number":2216,"context_line":"            unmanaged_snap_name \u003d snap_name"},{"line_number":2217,"context_line":"        self.driver.unmanage_snapshot(snap)"},{"line_number":2218,"context_line":"        self.array.rename_volume.assert_called_with(snap_name,"},{"line_number":2219,"context_line":"                                                    unmanaged_snap_name)"},{"line_number":2220,"context_line":""},{"line_number":2221,"context_line":"    def test_unmanage_snapshot_error_propagates(self):"},{"line_number":2222,"context_line":"        snap, _ \u003d self.new_fake_snap()"},{"line_number":2223,"context_line":"        self.assert_error_propagates([self.array.rename_volume],"}],"source_content_type":"text/x-python","patch_set":12,"id":"a69adc89_c92ec05c","line":2220,"range":{"start_line":2211,"start_character":0,"end_line":2220,"end_character":0},"in_reply_to":"fd4a32ee_32678509","updated":"2021-03-06 14:18:48.000000000","message":"Done","commit_id":"856b0ef6401b27299f6dae020101e70a7ba09e88"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"b10e6fc018a5df906e4f0d43219d64888e5c7a5a","unresolved":true,"context_lines":[{"line_number":2234,"context_line":""},{"line_number":2235,"context_line":"    def test_unmanage_snapshot_with_deleted_snapshot(self):"},{"line_number":2236,"context_line":"        snap, snap_name \u003d self.new_fake_snap()"},{"line_number":2237,"context_line":"        if len(snap_name + UNMANAGED_SUFFIX) \u003e MAX_SNAP_LENGTH:"},{"line_number":2238,"context_line":"            unmanaged_snap_name \u003d snap_name[:-len(UNMANAGED_SUFFIX)] + \\"},{"line_number":2239,"context_line":"                UNMANAGED_SUFFIX"},{"line_number":2240,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":14,"id":"8ad13cbd_b31a6690","line":2237,"updated":"2021-03-06 18:24:42.000000000","message":"you could change this test like the one above, but I won\u0027t insist (though compare the test coverage report for unmanage() to unmanage_snapshot())","commit_id":"bb219d6b9f62cc549cb9fe38b60e5e0b5aa450cf"}],"cinder/volume/drivers/pure.py":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"bb436a5c8298598ffbd1d089ff8a5ee5737d73db","unresolved":true,"context_lines":[{"line_number":1271,"context_line":"        \"\"\""},{"line_number":1272,"context_line":""},{"line_number":1273,"context_line":"        vol_name \u003d self._get_vol_name(volume)"},{"line_number":1274,"context_line":"        if len(vol_name + UNMANAGED_SUFFIX) \u003e 63:"},{"line_number":1275,"context_line":"            unmanaged_vol_name \u003d vol_name[:-len(UNMANAGED_SUFFIX)] + \\"},{"line_number":1276,"context_line":"                UNMANAGED_SUFFIX"},{"line_number":1277,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"94ef1622_382091ca","line":1274,"range":{"start_line":1274,"start_character":46,"end_line":1274,"end_character":48},"updated":"2021-03-06 00:08:50.000000000","message":"It would be good to define this up with the other constants so it\u0027s clear what the number means (and then you can refer to the constant in your tests).  Same thing about the 96 at line 1335.","commit_id":"856b0ef6401b27299f6dae020101e70a7ba09e88"},{"author":{"_account_id":13425,"name":"Simon Dodsley","email":"simon@purestorage.com","username":"sdodsley"},"change_message_id":"e223a81348682123578e7cc8fdaa354c6bf841ec","unresolved":false,"context_lines":[{"line_number":1271,"context_line":"        \"\"\""},{"line_number":1272,"context_line":""},{"line_number":1273,"context_line":"        vol_name \u003d self._get_vol_name(volume)"},{"line_number":1274,"context_line":"        if len(vol_name + UNMANAGED_SUFFIX) \u003e 63:"},{"line_number":1275,"context_line":"            unmanaged_vol_name \u003d vol_name[:-len(UNMANAGED_SUFFIX)] + \\"},{"line_number":1276,"context_line":"                UNMANAGED_SUFFIX"},{"line_number":1277,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"e2d6afb1_4d761065","line":1274,"range":{"start_line":1274,"start_character":46,"end_line":1274,"end_character":48},"in_reply_to":"94ef1622_382091ca","updated":"2021-03-06 14:18:48.000000000","message":"Done","commit_id":"856b0ef6401b27299f6dae020101e70a7ba09e88"}],"releasenotes/notes/bug-1870103-013e314e9a5b8e08.yaml":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"cc50493c4c20f8a145e3d868ea03e054b251acea","unresolved":true,"context_lines":[{"line_number":5,"context_line":"    Resolve mathematical typo in previous commit"},{"line_number":6,"context_line":"  - |"},{"line_number":7,"context_line":"    Ensure that unmanaged volumes do not exceed maximum character"},{"line_number":8,"context_line":"    length on FlashArray"}],"source_content_type":"text/x-yaml","patch_set":10,"id":"7d83286a_f1dbaf7c","line":8,"updated":"2021-02-19 22:05:44.000000000","message":"We\u0027re trying to standardize the release notes to make them easier for operators to find info relevant to them.  So two comments about this release note:\n\n(1) See https://docs.openstack.org/cinder/latest/contributor/releasenotes.html#drivers for the format\n\n(2) Write just one bullet point (or if you want to have multiple points about this fix, make it a sub-list).  Otherwise there\u0027s nothing connecting these two points.  For this fix, I suggest just a single point, something like:\n\n  - |\n    Pure storage driver `bug 1870103\n    \u003chttps://bugs.launchpad.net/cinder/+bug/1870103\u003e`_: Ensure that\n    the name used for an unmanaged volume does not exceed the maximum\n    character length on allowed on FlashArray.\n\nFor future reference, you would do a sub-list like this:\n\n  - |\n    Bug info:\n\n    * point one\n    * point two\n    * point three","commit_id":"34cf4167f3ee2619e6bca5531e1638a0efa8e8ca"},{"author":{"_account_id":13425,"name":"Simon Dodsley","email":"simon@purestorage.com","username":"sdodsley"},"change_message_id":"794433d47730ece2551e7a03b22c732deefe92cf","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    Resolve mathematical typo in previous commit"},{"line_number":6,"context_line":"  - |"},{"line_number":7,"context_line":"    Ensure that unmanaged volumes do not exceed maximum character"},{"line_number":8,"context_line":"    length on FlashArray"}],"source_content_type":"text/x-yaml","patch_set":10,"id":"655a9588_4b377aea","line":8,"in_reply_to":"7d83286a_f1dbaf7c","updated":"2021-02-24 18:37:37.000000000","message":"Ack","commit_id":"34cf4167f3ee2619e6bca5531e1638a0efa8e8ca"}]}
