)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"fd7ded8430accb7401ba8b97af8dd4f416d5732d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change the way of getting device name when nova-compute running under HVM domain"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Do not rely on XenAPI in function nova/nova/virt/xenapi/vm_utils.py"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Closes-Bug: #1318544"},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a4dcd0f_729fd565","line":9,"updated":"2015-08-14 12:28:16.000000000","message":"Please expand on why we cannot rely on this function, e.g. \"In some versions of XS the function assumes all HVM domains are Windows and so returns an incorrect device name.  In all XS versions the value from XAPI is just a guess and the guest kernel may decide to use a different device name.\n\nAlso please mention that the new method means we do not need any hacks, such as for maverick support.","commit_id":"0da64848f2b1f8a8072a648862a2ada2d1264f5c"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"fd7ded8430accb7401ba8b97af8dd4f416d5732d","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Do not rely on XenAPI in function nova/nova/virt/xenapi/vm_utils.py"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Closes-Bug: #1318544"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Ia61d1c212a115168f8a22fc513b6baf2102a30d1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a4dcd0f_326b8df3","line":12,"updated":"2015-08-14 12:28:16.000000000","message":"We are removing some configuration options - I think this may need a Doc-Impact tag?","commit_id":"0da64848f2b1f8a8072a648862a2ada2d1264f5c"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"9ce22abe72accd0668b1d79411d9f9218f7df117","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     huan \u003chuan.xie@citrix.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-18 10:14:25 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not rely on XenAPI in function nova/virt/xenapi/vm_utils.py"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The reason is in some version of xenserver, it assumes all HVM domains"},{"line_number":10,"context_line":"are Windows and returns incorrect device name."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"fa1b9901_7a7d40b0","line":7,"updated":"2015-08-18 22:48:54.000000000","message":"I\u0027d prefer \"Do not rely on XenAPI to guess device names\"","commit_id":"88b93484a49ebb5b57156cc74febf4de95fce68a"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"eb47afab6c7db01ff0ef3cf26db97d1ad717bc75","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Closes-Bug: #1318544"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"DocImpact: Remove two config variables \u0027remap_vbd_dev\u0027 and"},{"line_number":19,"context_line":"           \u0027remap_vbd_dev_prefix\u0027 in nova/virt/xenapi/driver.py"},{"line_number":20,"context_line":"           The new implementation do not rely on XenAPI call and the"},{"line_number":21,"context_line":"           two config variables are not used any more"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"fa1b9901_fdc6d19a","line":18,"updated":"2015-08-26 10:43:05.000000000","message":"s/Remove/Deprecate/","commit_id":"b0ebf05edd7f5e5dc8edf08efbd65cf46525508e"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"c7d47db56dd405703e21fea502dc683e582d016f","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Closes-Bug: #1318544"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"DocImpact: Remove two config variables \u0027remap_vbd_dev\u0027 and"},{"line_number":19,"context_line":"           \u0027remap_vbd_dev_prefix\u0027 in nova/virt/xenapi/driver.py"},{"line_number":20,"context_line":"           The new implementation do not rely on XenAPI call and the"},{"line_number":21,"context_line":"           two config variables are not used any more"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da20952f_2614d1f3","line":18,"in_reply_to":"fa1b9901_fdc6d19a","updated":"2015-08-27 02:12:03.000000000","message":"Yes, I will replace \u0027Remove\u0027 to \u0027Deprecate\u0027","commit_id":"b0ebf05edd7f5e5dc8edf08efbd65cf46525508e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"087922597ce9b340020e456c1a3ab18e0ce1df78","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Closes-Bug: #1318544"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"DocImpact: Remove two config variables \u0027remap_vbd_dev\u0027 and"},{"line_number":19,"context_line":"           \u0027remap_vbd_dev_prefix\u0027 in nova/conf/xenserver.py"},{"line_number":20,"context_line":"           The new implementation do not rely on XenAPI call and the"},{"line_number":21,"context_line":"           two config variables are not used any more"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: Ia61d1c212a115168f8a22fc513b6baf2102a30d1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"9a629dbe_a7b63f88","line":21,"range":{"start_line":18,"start_character":0,"end_line":21,"end_character":53},"updated":"2016-11-08 11:23:00.000000000","message":"Don\u0027t include this - simply remove the option and include a release note as you\u0027ve done","commit_id":"96e481cd14b1f42d98cfdb788e0e0566afe24164"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"3646c3b823f63928a713e8929cc0bc7e411b263e","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Closes-Bug: #1318544"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"DocImpact: Remove two config variables \u0027remap_vbd_dev\u0027 and"},{"line_number":19,"context_line":"           \u0027remap_vbd_dev_prefix\u0027 in nova/conf/xenserver.py"},{"line_number":20,"context_line":"           The new implementation do not rely on XenAPI call and the"},{"line_number":21,"context_line":"           two config variables are not used any more"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: Ia61d1c212a115168f8a22fc513b6baf2102a30d1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"9a629dbe_90dea60f","line":21,"range":{"start_line":18,"start_character":0,"end_line":21,"end_character":53},"in_reply_to":"9a629dbe_a7b63f88","updated":"2016-11-09 05:23:20.000000000","message":"Done","commit_id":"96e481cd14b1f42d98cfdb788e0e0566afe24164"}],"nova/conf/xenserver.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"17298b24fffbc049b93d1f4396fec17149adf9d2","unresolved":false,"context_lines":[{"line_number":335,"context_line":"    cfg.StrOpt(\u0027remap_vbd_dev_prefix\u0027,"},{"line_number":336,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":337,"context_line":"               help\u003d\u0027Specify prefix to remap VBD dev to \u0027"},{"line_number":338,"context_line":"                    \u0027(ex. /dev/xvdb -\u003e /dev/sdb)\u0027),"},{"line_number":339,"context_line":"]"},{"line_number":340,"context_line":""},{"line_number":341,"context_line":"xenapi_vmops_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":26,"id":"9abb7d3a_7a19fbd6","side":"PARENT","line":338,"updated":"2016-05-31 13:58:32.000000000","message":"These must be deprecated first, right?","commit_id":"5fb3e39e478fc661668634f5e097c4fa776b7331"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"03651617facd2d1f1931fe8cc268da961dd440f5","unresolved":false,"context_lines":[{"line_number":335,"context_line":"    cfg.StrOpt(\u0027remap_vbd_dev_prefix\u0027,"},{"line_number":336,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":337,"context_line":"               help\u003d\u0027Specify prefix to remap VBD dev to \u0027"},{"line_number":338,"context_line":"                    \u0027(ex. /dev/xvdb -\u003e /dev/sdb)\u0027),"},{"line_number":339,"context_line":"]"},{"line_number":340,"context_line":""},{"line_number":341,"context_line":"xenapi_vmops_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_670df08e","side":"PARENT","line":338,"in_reply_to":"9abb7d3a_7a19fbd6","updated":"2016-06-17 10:29:19.000000000","message":"At first we did make these as deprecated, but I got some comments from Daniel Berrange in patch-21:\n\"\ndeprecated_for_removal is applicable if the current code uses the conf values, and next release will delete them.\nYou are deleting all usage of these config parameters in this patch though. So deprecation serves no purpose - the config values are immediately useless to users.\nSO either you should deprecated the config params in Mitaka, and then change the code in Newton. Or you should just delete the config parameters \u0026 change the code all in Mitaka.\nGiven that this change is fixing a functional bug in current code, I\u0027d vote for just deleting the config parameters completely in Mitaka.\n\"","commit_id":"5fb3e39e478fc661668634f5e097c4fa776b7331"}],"nova/tests/unit/virt/xenapi/test_vm_utils.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"234d73831109791d10ef7a458a7fe1a0d96eb940","unresolved":false,"context_lines":[{"line_number":1821,"context_line":"class GetVbdPathTestCase(VMUtilsTestBase):"},{"line_number":1822,"context_line":"    @mock.patch.object(glob, \u0027glob\u0027)"},{"line_number":1823,"context_line":"    def test_get_vbd_path(self, mock_glob):"},{"line_number":1824,"context_line":"        self.mox.StubOutWithMock(utils, \u0027execute\u0027)"},{"line_number":1825,"context_line":"        mock_glob.return_value \u003d [\u0027/sys/devices/vbd-333\u0027]"},{"line_number":1826,"context_line":"        fake_domid \u003d \u00275\u0027"},{"line_number":1827,"context_line":"        fake_vbd_backend \u003d \u0027/local/domain/5/device/vbd/333/backend\u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"da20952f_9179defe","line":1824,"updated":"2015-09-11 11:12:48.000000000","message":"This seems to be a mix-and-match between Mock and Mox; Can we just use Mock here please?","commit_id":"adace5a4e7eec4ad13157743540d7bc7eca338d0"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"5065e0302d5e48564f9752b56d1a55595a6a41b0","unresolved":false,"context_lines":[{"line_number":1821,"context_line":"class GetVbdPathTestCase(VMUtilsTestBase):"},{"line_number":1822,"context_line":"    @mock.patch.object(glob, \u0027glob\u0027)"},{"line_number":1823,"context_line":"    def test_get_vbd_path(self, mock_glob):"},{"line_number":1824,"context_line":"        self.mox.StubOutWithMock(utils, \u0027execute\u0027)"},{"line_number":1825,"context_line":"        mock_glob.return_value \u003d [\u0027/sys/devices/vbd-333\u0027]"},{"line_number":1826,"context_line":"        fake_domid \u003d \u00275\u0027"},{"line_number":1827,"context_line":"        fake_vbd_backend \u003d \u0027/local/domain/5/device/vbd/333/backend\u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_4d09ef94","line":1824,"in_reply_to":"da20952f_9179defe","updated":"2015-09-14 05:05:35.000000000","message":"Yes, I will change this part","commit_id":"adace5a4e7eec4ad13157743540d7bc7eca338d0"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"234d73831109791d10ef7a458a7fe1a0d96eb940","unresolved":false,"context_lines":[{"line_number":1828,"context_line":"        fake_vbd_backend_ret \u003d \u0027local/domain/0/backend/vbd5/5/333\u0027"},{"line_number":1829,"context_line":"        fake_vdi_path \u003d fake_vbd_backend_ret + \u0027/vdi\u0027"},{"line_number":1830,"context_line":"        fake_vdi_info \u003d \u0027uuid:333, other:xxx\u0027"},{"line_number":1831,"context_line":"        utils.execute(\u0027xenstore-read\u0027, \u0027domid\u0027, run_as_root\u003dTrue).\\"},{"line_number":1832,"context_line":"            AndReturn((fake_domid, \u0027\u0027))"},{"line_number":1833,"context_line":"        utils.execute(\u0027xenstore-read\u0027, fake_vbd_backend, run_as_root\u003dTrue).\\"},{"line_number":1834,"context_line":"            AndReturn((fake_vbd_backend_ret, \u0027\u0027))"}],"source_content_type":"text/x-python","patch_set":10,"id":"da20952f_51cd862e","line":1831,"updated":"2015-09-11 11:12:48.000000000","message":"To have multiple return values with Mock, use side_effect \u003d function or an array (assuming we know the order of the calls).  See fake_get_rec in the GetAllVDIsTestCase above","commit_id":"adace5a4e7eec4ad13157743540d7bc7eca338d0"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"5065e0302d5e48564f9752b56d1a55595a6a41b0","unresolved":false,"context_lines":[{"line_number":1828,"context_line":"        fake_vbd_backend_ret \u003d \u0027local/domain/0/backend/vbd5/5/333\u0027"},{"line_number":1829,"context_line":"        fake_vdi_path \u003d fake_vbd_backend_ret + \u0027/vdi\u0027"},{"line_number":1830,"context_line":"        fake_vdi_info \u003d \u0027uuid:333, other:xxx\u0027"},{"line_number":1831,"context_line":"        utils.execute(\u0027xenstore-read\u0027, \u0027domid\u0027, run_as_root\u003dTrue).\\"},{"line_number":1832,"context_line":"            AndReturn((fake_domid, \u0027\u0027))"},{"line_number":1833,"context_line":"        utils.execute(\u0027xenstore-read\u0027, fake_vbd_backend, run_as_root\u003dTrue).\\"},{"line_number":1834,"context_line":"            AndReturn((fake_vbd_backend_ret, \u0027\u0027))"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_cdf5ff83","line":1831,"in_reply_to":"da20952f_51cd862e","updated":"2015-09-14 05:05:35.000000000","message":"Thanks, get the idea from fake_get_rec","commit_id":"adace5a4e7eec4ad13157743540d7bc7eca338d0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2c29325e1dc8fda012f5c0501dfab760f5c8ee0f","unresolved":false,"context_lines":[{"line_number":1854,"context_line":"                          vm_utils._get_vbd_path, \u0027111\u0027)"},{"line_number":1855,"context_line":""},{"line_number":1856,"context_line":""},{"line_number":1857,"context_line":"class WaitForDeviceTestCase(VMUtilsTestBase):"},{"line_number":1858,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":1859,"context_line":"    @mock.patch.object(utils, \u0027make_dev_path\u0027)"},{"line_number":1860,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_d7749afe","line":1857,"updated":"2015-09-14 13:43:22.000000000","message":"I don\u0027t see you mocking out sleep here?\n\nI also notice this:\n2015-09-14 05:40:05.467 | nova.tests.unit.virt.xenapi.test_vm_utils.WaitForDeviceTestCase.test_wait_for_device_empty_block_path  10.016\n2015-09-14 05:40:05.468 | nova.tests.unit.virt.xenapi.test_vm_utils.WaitForDeviceTestCase.test_wait_for_device_make_path_fail    10.011","commit_id":"91ca3445d4ac3f1307175f4f19fa0a921695251a"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"afcc9631658524721a688b96188634a7bbfa4ba8","unresolved":false,"context_lines":[{"line_number":1854,"context_line":"                          vm_utils._get_vbd_path, \u0027111\u0027)"},{"line_number":1855,"context_line":""},{"line_number":1856,"context_line":""},{"line_number":1857,"context_line":"class WaitForDeviceTestCase(VMUtilsTestBase):"},{"line_number":1858,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":1859,"context_line":"    @mock.patch.object(utils, \u0027make_dev_path\u0027)"},{"line_number":1860,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_bc31b0a4","line":1857,"in_reply_to":"ba15a1d1_d7749afe","updated":"2015-09-15 02:24:28.000000000","message":"Thanks very much for your so careful review, sorry that I don\u0027t realize the execution time. I have checked the log and I will mock sleep() and pay attention on this:)","commit_id":"91ca3445d4ac3f1307175f4f19fa0a921695251a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2c29325e1dc8fda012f5c0501dfab760f5c8ee0f","unresolved":false,"context_lines":[{"line_number":1871,"context_line":"        vbd_path \u003d \u0027/sys/devices/vbd-333\u0027"},{"line_number":1872,"context_line":"        mock_listdir.return_value \u003d []"},{"line_number":1873,"context_line":"        self.assertRaises(exception.StorageError,"},{"line_number":1874,"context_line":"                          vm_utils._wait_for_device, vbd_path)"},{"line_number":1875,"context_line":""},{"line_number":1876,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":1877,"context_line":"    @mock.patch.object(utils, \u0027make_dev_path\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_175c524a","line":1874,"updated":"2015-09-14 13:43:22.000000000","message":"can you test how many times the retry was attempted please?\n\nmaybe look at mock_listdir.call_count or similar?","commit_id":"91ca3445d4ac3f1307175f4f19fa0a921695251a"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"afcc9631658524721a688b96188634a7bbfa4ba8","unresolved":false,"context_lines":[{"line_number":1871,"context_line":"        vbd_path \u003d \u0027/sys/devices/vbd-333\u0027"},{"line_number":1872,"context_line":"        mock_listdir.return_value \u003d []"},{"line_number":1873,"context_line":"        self.assertRaises(exception.StorageError,"},{"line_number":1874,"context_line":"                          vm_utils._wait_for_device, vbd_path)"},{"line_number":1875,"context_line":""},{"line_number":1876,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":1877,"context_line":"    @mock.patch.object(utils, \u0027make_dev_path\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_bc79b095","line":1874,"in_reply_to":"ba15a1d1_175c524a","updated":"2015-09-15 02:24:28.000000000","message":"sure, I can add this checking","commit_id":"91ca3445d4ac3f1307175f4f19fa0a921695251a"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"4bce33b3a5c976bb663efa6601a249083bc9085d","unresolved":false,"context_lines":[{"line_number":1832,"context_line":"    @mock.patch.object(glob, \u0027glob\u0027)"},{"line_number":1833,"context_line":"    @mock.patch.object(utils, \u0027execute\u0027)"},{"line_number":1834,"context_line":"    def test_get_vbd_path(self, mock_execute, mock_glob):"},{"line_number":1835,"context_line":"        def fake_execute(*cmd, **kwargs):"},{"line_number":1836,"context_line":"            if \u0027domid\u0027 in cmd:"},{"line_number":1837,"context_line":"                return (\u00275\u0027, \u0027\u0027)"},{"line_number":1838,"context_line":"            if \u0027/local/domain/5/device/vbd/333/backend\u0027 in cmd:"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_83538116","line":1835,"updated":"2016-04-20 15:15:06.000000000","message":"Can this verify that the command starts with xenstore-read?  Just to be clear what it\u0027s doing.","commit_id":"65827356a6b703e1fde807c85d5615c57dd96a11"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"e6e9dfa88ca3fe89da6fb9e76f4ca06fcf50daeb","unresolved":false,"context_lines":[{"line_number":1832,"context_line":"    @mock.patch.object(glob, \u0027glob\u0027)"},{"line_number":1833,"context_line":"    @mock.patch.object(utils, \u0027execute\u0027)"},{"line_number":1834,"context_line":"    def test_get_vbd_path(self, mock_execute, mock_glob):"},{"line_number":1835,"context_line":"        def fake_execute(*cmd, **kwargs):"},{"line_number":1836,"context_line":"            if \u0027domid\u0027 in cmd:"},{"line_number":1837,"context_line":"                return (\u00275\u0027, \u0027\u0027)"},{"line_number":1838,"context_line":"            if \u0027/local/domain/5/device/vbd/333/backend\u0027 in cmd:"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_a0c125e6","line":1835,"in_reply_to":"1a122d0e_83538116","updated":"2016-04-22 03:49:46.000000000","message":"Done","commit_id":"65827356a6b703e1fde807c85d5615c57dd96a11"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"4bce33b3a5c976bb663efa6601a249083bc9085d","unresolved":false,"context_lines":[{"line_number":1840,"context_line":"            if \u0027local/domain/0/backend/vbd5/5/333/vdi\u0027 in cmd:"},{"line_number":1841,"context_line":"                return (\u0027uuid:333, other:xxx\u0027, \u0027\u0027)"},{"line_number":1842,"context_line":""},{"line_number":1843,"context_line":"        mock_glob.return_value \u003d [\u0027/sys/devices/vbd-333\u0027]"},{"line_number":1844,"context_line":"        utils.execute.side_effect \u003d fake_execute"},{"line_number":1845,"context_line":"        self.assertEqual(\u0027/sys/devices/vbd-333\u0027,"},{"line_number":1846,"context_line":"                        vm_utils._get_vbd_path(\u0027333\u0027))"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_8869defb","line":1843,"updated":"2016-04-20 15:15:06.000000000","message":"List only needed if there is more than one call to mock_glob","commit_id":"65827356a6b703e1fde807c85d5615c57dd96a11"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"e6e9dfa88ca3fe89da6fb9e76f4ca06fcf50daeb","unresolved":false,"context_lines":[{"line_number":1840,"context_line":"            if \u0027local/domain/0/backend/vbd5/5/333/vdi\u0027 in cmd:"},{"line_number":1841,"context_line":"                return (\u0027uuid:333, other:xxx\u0027, \u0027\u0027)"},{"line_number":1842,"context_line":""},{"line_number":1843,"context_line":"        mock_glob.return_value \u003d [\u0027/sys/devices/vbd-333\u0027]"},{"line_number":1844,"context_line":"        utils.execute.side_effect \u003d fake_execute"},{"line_number":1845,"context_line":"        self.assertEqual(\u0027/sys/devices/vbd-333\u0027,"},{"line_number":1846,"context_line":"                        vm_utils._get_vbd_path(\u0027333\u0027))"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_60308408","line":1843,"in_reply_to":"1a122d0e_8869defb","updated":"2016-04-22 03:49:46.000000000","message":"glob.glob(path)\u0027s return value is list, so this mock_glob.return_value is for one call. If we want to return values in multiple call, we set list [ret_value1, ret_value2, ...] to side_effect, not return_value","commit_id":"65827356a6b703e1fde807c85d5615c57dd96a11"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"4bce33b3a5c976bb663efa6601a249083bc9085d","unresolved":false,"context_lines":[{"line_number":1877,"context_line":"    @mock.patch.object(vm_utils, \u0027_get_vbd_path\u0027)"},{"line_number":1878,"context_line":"    @mock.patch.object(time, \u0027sleep\u0027)"},{"line_number":1879,"context_line":"    def test_wait_for_device_empty_vbd(self, mock_sleep, mock_get_vbd_path):"},{"line_number":1880,"context_line":"        mock_get_vbd_path.return_value \u003d None"},{"line_number":1881,"context_line":"        self.assertRaises(exception.StorageError,"},{"line_number":1882,"context_line":"                          vm_utils._wait_for_device, \u0027111\u0027)"},{"line_number":1883,"context_line":"        self.assertEqual(CONF.xenserver.block_device_creation_timeout,"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_3ec3a058","line":1880,"updated":"2016-04-20 15:15:06.000000000","message":"Keep this test, but also add a \"test_wait_for_device_retry_vbd\" with mock_get_vbd_path.return_value\u003d[None, None, \u0027xvdb\u0027] and then ensure mock_get_vbd_path was called 3 times, and then succeeded.\nNeed a similar test for the return value of os.listdir as well.","commit_id":"65827356a6b703e1fde807c85d5615c57dd96a11"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"e6e9dfa88ca3fe89da6fb9e76f4ca06fcf50daeb","unresolved":false,"context_lines":[{"line_number":1877,"context_line":"    @mock.patch.object(vm_utils, \u0027_get_vbd_path\u0027)"},{"line_number":1878,"context_line":"    @mock.patch.object(time, \u0027sleep\u0027)"},{"line_number":1879,"context_line":"    def test_wait_for_device_empty_vbd(self, mock_sleep, mock_get_vbd_path):"},{"line_number":1880,"context_line":"        mock_get_vbd_path.return_value \u003d None"},{"line_number":1881,"context_line":"        self.assertRaises(exception.StorageError,"},{"line_number":1882,"context_line":"                          vm_utils._wait_for_device, \u0027111\u0027)"},{"line_number":1883,"context_line":"        self.assertEqual(CONF.xenserver.block_device_creation_timeout,"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_314b7c5b","line":1880,"in_reply_to":"1a122d0e_3ec3a058","updated":"2016-04-22 03:49:46.000000000","message":"Done, vm_utils._get_vbd_path.side_effect \u003d [None, None, \u0027xvdb\u0027]","commit_id":"65827356a6b703e1fde807c85d5615c57dd96a11"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"692cc8e0992458111e9093aaba8ccb5d31674288","unresolved":false,"context_lines":[{"line_number":1877,"context_line":"    @mock.patch.object(vm_utils, \u0027_get_vbd_path\u0027)"},{"line_number":1878,"context_line":"    @mock.patch.object(time, \u0027sleep\u0027)"},{"line_number":1879,"context_line":"    def test_wait_for_device_empty_vbd(self, mock_sleep, mock_get_vbd_path):"},{"line_number":1880,"context_line":"        mock_get_vbd_path.return_value \u003d None"},{"line_number":1881,"context_line":"        self.assertRaises(exception.StorageError,"},{"line_number":1882,"context_line":"                          vm_utils._wait_for_device, \u0027111\u0027)"},{"line_number":1883,"context_line":"        self.assertEqual(CONF.xenserver.block_device_creation_timeout,"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_467da0e6","line":1880,"in_reply_to":"1a122d0e_3ec3a058","updated":"2016-04-22 03:20:28.000000000","message":"use mock\u0027s side_effect to return different values sequentially:\ne.g. mock_get_vbd_path.side_effect\u003d[None, None, \u0027xvdb\u0027]","commit_id":"65827356a6b703e1fde807c85d5615c57dd96a11"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"4bce33b3a5c976bb663efa6601a249083bc9085d","unresolved":false,"context_lines":[{"line_number":1882,"context_line":"                          vm_utils._wait_for_device, \u0027111\u0027)"},{"line_number":1883,"context_line":"        self.assertEqual(CONF.xenserver.block_device_creation_timeout,"},{"line_number":1884,"context_line":"                         mock_sleep.call_count)"},{"line_number":1885,"context_line":""},{"line_number":1886,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":1887,"context_line":"    @mock.patch.object(time, \u0027sleep\u0027)"},{"line_number":1888,"context_line":"    @mock.patch.object(vm_utils, \u0027_get_vbd_path\u0027)"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_de9eec05","line":1885,"updated":"2016-04-20 15:15:06.000000000","message":"Also have a test with:\nmock_get_vbd_patch.return_value \u003d ([None]*CONF.xenserver.block_device_creation_timeout-2)+[\u0027xvdb\u0027]\nthen:\nmock_listdir \u003d [None, None, \u0027xvdb\u0027]\nThis will ensure that the combination of the two loops will not exceed block_device_creation_timeout.","commit_id":"65827356a6b703e1fde807c85d5615c57dd96a11"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"e6e9dfa88ca3fe89da6fb9e76f4ca06fcf50daeb","unresolved":false,"context_lines":[{"line_number":1882,"context_line":"                          vm_utils._wait_for_device, \u0027111\u0027)"},{"line_number":1883,"context_line":"        self.assertEqual(CONF.xenserver.block_device_creation_timeout,"},{"line_number":1884,"context_line":"                         mock_sleep.call_count)"},{"line_number":1885,"context_line":""},{"line_number":1886,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":1887,"context_line":"    @mock.patch.object(time, \u0027sleep\u0027)"},{"line_number":1888,"context_line":"    @mock.patch.object(vm_utils, \u0027_get_vbd_path\u0027)"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_d1c0487f","line":1885,"in_reply_to":"1a122d0e_de9eec05","updated":"2016-04-22 03:49:46.000000000","message":"Done","commit_id":"65827356a6b703e1fde807c85d5615c57dd96a11"}],"nova/tests/unit/virt/xenapi/test_xenapi.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"234d73831109791d10ef7a458a7fe1a0d96eb940","unresolved":false,"context_lines":[{"line_number":185,"context_line":"    return fake"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"def fake_get_vbd_path(vdi_uuid):"},{"line_number":189,"context_line":"    \"\"\"fake vm_utils._get_vbd_path, this function has system calls, so we fake"},{"line_number":190,"context_line":"    it to avoid call down to filesystem"},{"line_number":191,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"da20952f_b168a2f6","line":188,"updated":"2015-09-11 11:12:48.000000000","message":"I think this needs to be moved to an inner function, for example XenAPIVMTestCase.setUp.fake_inject_instance_metadata","commit_id":"adace5a4e7eec4ad13157743540d7bc7eca338d0"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"5065e0302d5e48564f9752b56d1a55595a6a41b0","unresolved":false,"context_lines":[{"line_number":185,"context_line":"    return fake"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"def fake_get_vbd_path(vdi_uuid):"},{"line_number":189,"context_line":"    \"\"\"fake vm_utils._get_vbd_path, this function has system calls, so we fake"},{"line_number":190,"context_line":"    it to avoid call down to filesystem"},{"line_number":191,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_eaf22906","line":188,"in_reply_to":"da20952f_b168a2f6","updated":"2015-09-14 05:05:35.000000000","message":"yes, checked the code and it should be moved to XenAPIVMTestCase. I should notice that before delivery","commit_id":"adace5a4e7eec4ad13157743540d7bc7eca338d0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2c29325e1dc8fda012f5c0501dfab760f5c8ee0f","unresolved":false,"context_lines":[{"line_number":772,"context_line":"        # Fake system call os.listdir()"},{"line_number":773,"context_line":"        def fake_listdir(path):"},{"line_number":774,"context_line":"            return [\u0027fake_xvda\u0027, \u0027fake_xvdb\u0027]"},{"line_number":775,"context_line":"        self.stubs.Set(os, \u0027listdir\u0027, fake_listdir)"},{"line_number":776,"context_line":""},{"line_number":777,"context_line":"        # Fake utils.make_dev_path() to avoid system call os.path.join()"},{"line_number":778,"context_line":"        def fake_make_dev_path(dev, partition\u003dNone, base\u003d\u0027/dev\u0027):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_1724520b","line":775,"updated":"2015-09-14 13:43:22.000000000","message":"Why not stub out all of _wait_for_device, I think that would be neater, given the sleep in there?","commit_id":"91ca3445d4ac3f1307175f4f19fa0a921695251a"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"afcc9631658524721a688b96188634a7bbfa4ba8","unresolved":false,"context_lines":[{"line_number":772,"context_line":"        # Fake system call os.listdir()"},{"line_number":773,"context_line":"        def fake_listdir(path):"},{"line_number":774,"context_line":"            return [\u0027fake_xvda\u0027, \u0027fake_xvdb\u0027]"},{"line_number":775,"context_line":"        self.stubs.Set(os, \u0027listdir\u0027, fake_listdir)"},{"line_number":776,"context_line":""},{"line_number":777,"context_line":"        # Fake utils.make_dev_path() to avoid system call os.path.join()"},{"line_number":778,"context_line":"        def fake_make_dev_path(dev, partition\u003dNone, base\u003d\u0027/dev\u0027):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_5ccad4a2","line":775,"in_reply_to":"ba15a1d1_1724520b","updated":"2015-09-15 02:24:28.000000000","message":"agree, stub whole _wait_for_device is better. And the individual functions added has been tested in test_vm_utils.py. Thanks very much I will change this.","commit_id":"91ca3445d4ac3f1307175f4f19fa0a921695251a"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"fe387c0244ecc83630ec4391e5da2c3d7ae7f086","unresolved":false,"context_lines":[{"line_number":1557,"context_line":"        network_info \u003d fake_network.fake_get_instance_nw_info(self.stubs)"},{"line_number":1558,"context_line":"        image_meta \u003d {\u0027id\u0027: IMAGE_VHD,"},{"line_number":1559,"context_line":"                      \u0027disk_format\u0027: \u0027vhd\u0027}"},{"line_number":1560,"context_line":""},{"line_number":1561,"context_line":"        if spawn:"},{"line_number":1562,"context_line":"            self.conn.spawn(self.context, instance, image_meta, [], \u0027herp\u0027,"},{"line_number":1563,"context_line":"                            network_info)"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a740942_511f7609","line":1560,"updated":"2015-12-09 11:29:19.000000000","message":"Not needed change - please revert","commit_id":"ff275d7146f84742267d07233082766f1abc478e"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"1a92513d2105580d7af3455d57d60fc7e6285036","unresolved":false,"context_lines":[{"line_number":1557,"context_line":"        network_info \u003d fake_network.fake_get_instance_nw_info(self.stubs)"},{"line_number":1558,"context_line":"        image_meta \u003d {\u0027id\u0027: IMAGE_VHD,"},{"line_number":1559,"context_line":"                      \u0027disk_format\u0027: \u0027vhd\u0027}"},{"line_number":1560,"context_line":""},{"line_number":1561,"context_line":"        if spawn:"},{"line_number":1562,"context_line":"            self.conn.spawn(self.context, instance, image_meta, [], \u0027herp\u0027,"},{"line_number":1563,"context_line":"                            network_info)"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a740942_6f3b829d","line":1560,"in_reply_to":"7a740942_511f7609","updated":"2015-12-10 01:25:42.000000000","message":"yes, it\u0027s my fault, will modify and push again","commit_id":"ff275d7146f84742267d07233082766f1abc478e"}],"nova/virt/xenapi/driver.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4fabc118553c5a0d05bf7ccbed7bd42dd02d8f03","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    cfg.BoolOpt(\u0027remap_vbd_dev\u0027,"},{"line_number":87,"context_line":"                default\u003dFalse,"},{"line_number":88,"context_line":"                help\u003d\u0027Used to enable the remapping of VBD dev \u0027"},{"line_number":89,"context_line":"                     \u0027(Works around an issue in Ubuntu Maverick)\u0027),"},{"line_number":90,"context_line":"    cfg.StrOpt(\u0027remap_vbd_dev_prefix\u0027,"},{"line_number":91,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":92,"context_line":"               help\u003d\u0027Specify prefix to remap VBD dev to \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_057911c8","side":"PARENT","line":89,"updated":"2015-08-25 17:09:17.000000000","message":"you can\u0027t drop config options without first deprecating them, its part of our guarantee to our users.\n\nThey must be deprecated for a release before we can remove them.","commit_id":"05dbd82a10fd9ea1172769c71f2170e359560f59"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"5a408425b59cb49a23d42c787f12389b7023f347","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    cfg.BoolOpt(\u0027remap_vbd_dev\u0027,"},{"line_number":87,"context_line":"                default\u003dFalse,"},{"line_number":88,"context_line":"                help\u003d\u0027Used to enable the remapping of VBD dev \u0027"},{"line_number":89,"context_line":"                     \u0027(Works around an issue in Ubuntu Maverick)\u0027),"},{"line_number":90,"context_line":"    cfg.StrOpt(\u0027remap_vbd_dev_prefix\u0027,"},{"line_number":91,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":92,"context_line":"               help\u003d\u0027Specify prefix to remap VBD dev to \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_698a15c1","side":"PARENT","line":89,"in_reply_to":"fa1b9901_0079ffc7","updated":"2015-08-26 03:20:39.000000000","message":"Sure, I have seen John\u0027s comments, I will change them back.","commit_id":"05dbd82a10fd9ea1172769c71f2170e359560f59"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"8fd6ad3c05b4393dea2b0646c7d40a22e83501b0","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    cfg.BoolOpt(\u0027remap_vbd_dev\u0027,"},{"line_number":87,"context_line":"                default\u003dFalse,"},{"line_number":88,"context_line":"                help\u003d\u0027Used to enable the remapping of VBD dev \u0027"},{"line_number":89,"context_line":"                     \u0027(Works around an issue in Ubuntu Maverick)\u0027),"},{"line_number":90,"context_line":"    cfg.StrOpt(\u0027remap_vbd_dev_prefix\u0027,"},{"line_number":91,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":92,"context_line":"               help\u003d\u0027Specify prefix to remap VBD dev to \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_0079ffc7","side":"PARENT","line":89,"in_reply_to":"fa1b9901_057911c8","updated":"2015-08-25 17:32:19.000000000","message":"After discussion with johnthetubaguy on IRC, we should mark these config options as deprecated and make sure that the deprecation message explains that they are no longer used.\n\nThe options need to stay present in the config file (even if ignored) for 1 release so people can upgrade Nova without changing the config file.","commit_id":"05dbd82a10fd9ea1172769c71f2170e359560f59"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"5a408425b59cb49a23d42c787f12389b7023f347","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    cfg.BoolOpt(\u0027remap_vbd_dev\u0027,"},{"line_number":87,"context_line":"                default\u003dFalse,"},{"line_number":88,"context_line":"                help\u003d\u0027Used to enable the remapping of VBD dev \u0027"},{"line_number":89,"context_line":"                     \u0027(Works around an issue in Ubuntu Maverick)\u0027),"},{"line_number":90,"context_line":"    cfg.StrOpt(\u0027remap_vbd_dev_prefix\u0027,"},{"line_number":91,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":92,"context_line":"               help\u003d\u0027Specify prefix to remap VBD dev to \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_6903f542","side":"PARENT","line":89,"in_reply_to":"fa1b9901_057911c8","updated":"2015-08-26 03:20:39.000000000","message":"Got it, I will keep them back and add comments to say that they are deprecated now and will be removed in the future.","commit_id":"05dbd82a10fd9ea1172769c71f2170e359560f59"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"eb47afab6c7db01ff0ef3cf26db97d1ad717bc75","unresolved":false,"context_lines":[{"line_number":83,"context_line":"               default\u003d\u0027iqn.2010-10.org.openstack\u0027,"},{"line_number":84,"context_line":"               help\u003d\u0027IQN Prefix\u0027),"},{"line_number":85,"context_line":"    # NOTE: The two config items are not used any more after fix bug 1318544."},{"line_number":86,"context_line":"    # The are deprecated now and will be removed in the future."},{"line_number":87,"context_line":"    cfg.BoolOpt(\u0027remap_vbd_dev\u0027,"},{"line_number":88,"context_line":"                default\u003dFalse,"},{"line_number":89,"context_line":"                help\u003d\u0027Used to enable the remapping of VBD dev \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa1b9901_bdde196b","line":86,"updated":"2015-08-26 10:43:05.000000000","message":"Please update the config to make it clear that it\u0027s deprecated, e.g.:\n    cfg.StrOpt(\u0027admin_auth_token\u0027,\n               secret\u003dTrue,\n               deprecated_for_removal\u003dTrue,\n               help\u003d\u0027Ironic keystone auth token.\u0027\n                    \u0027DEPRECATED: use admin_username, admin_password, and \u0027\n                    \u0027admin_tenant_name instead\u0027),\n\nThe help text should say something like \"DEPRECATED: This option is no longer used as the VBD paths are automatically determined\"","commit_id":"b0ebf05edd7f5e5dc8edf08efbd65cf46525508e"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"c7d47db56dd405703e21fea502dc683e582d016f","unresolved":false,"context_lines":[{"line_number":83,"context_line":"               default\u003d\u0027iqn.2010-10.org.openstack\u0027,"},{"line_number":84,"context_line":"               help\u003d\u0027IQN Prefix\u0027),"},{"line_number":85,"context_line":"    # NOTE: The two config items are not used any more after fix bug 1318544."},{"line_number":86,"context_line":"    # The are deprecated now and will be removed in the future."},{"line_number":87,"context_line":"    cfg.BoolOpt(\u0027remap_vbd_dev\u0027,"},{"line_number":88,"context_line":"                default\u003dFalse,"},{"line_number":89,"context_line":"                help\u003d\u0027Used to enable the remapping of VBD dev \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_460545c0","line":86,"in_reply_to":"fa1b9901_bdde196b","updated":"2015-08-27 02:12:03.000000000","message":"Sure, I will update this","commit_id":"b0ebf05edd7f5e5dc8edf08efbd65cf46525508e"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"5a149cd242af6baf7e08990a1f7d7a25dbaf40dc","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    cfg.BoolOpt(\u0027remap_vbd_dev\u0027,"},{"line_number":88,"context_line":"                default\u003dFalse,"},{"line_number":89,"context_line":"                deprecated_for_removal\u003dTrue,"},{"line_number":90,"context_line":"                help\u003d\u0027Used to enable the remapping of VBD dev \u0027"},{"line_number":91,"context_line":"                     \u0027(Works around an issue in Ubuntu Maverick)\u0027),"},{"line_number":92,"context_line":"    cfg.StrOpt(\u0027remap_vbd_dev_prefix\u0027,"},{"line_number":93,"context_line":"               default\u003d\u0027sd\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_372626cf","line":90,"updated":"2015-08-27 12:47:07.000000000","message":"Sorry Huan, please can you also change the \"help\" text to say:\n\"DEPRECATED: This option is ignored as the VBD path is determined automatically\"","commit_id":"8070bbe056141c43c248c4a8bb704430bc3e38e7"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"f3577a415d646f92ad26d1f392ab2dd09f7abbe3","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    cfg.BoolOpt(\u0027remap_vbd_dev\u0027,"},{"line_number":88,"context_line":"                default\u003dFalse,"},{"line_number":89,"context_line":"                deprecated_for_removal\u003dTrue,"},{"line_number":90,"context_line":"                help\u003d\u0027Used to enable the remapping of VBD dev \u0027"},{"line_number":91,"context_line":"                     \u0027(Works around an issue in Ubuntu Maverick)\u0027),"},{"line_number":92,"context_line":"    cfg.StrOpt(\u0027remap_vbd_dev_prefix\u0027,"},{"line_number":93,"context_line":"               default\u003d\u0027sd\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_1190a942","line":90,"in_reply_to":"da20952f_372626cf","updated":"2015-08-28 03:19:35.000000000","message":"sure, I can change this","commit_id":"8070bbe056141c43c248c4a8bb704430bc3e38e7"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"5a149cd242af6baf7e08990a1f7d7a25dbaf40dc","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    cfg.StrOpt(\u0027remap_vbd_dev_prefix\u0027,"},{"line_number":93,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":94,"context_line":"               deprecated_for_removal\u003dTrue,"},{"line_number":95,"context_line":"               help\u003d\u0027Specify prefix to remap VBD dev to \u0027"},{"line_number":96,"context_line":"                    \u0027(ex. /dev/xvdb -\u003e /dev/sdb)\u0027),"},{"line_number":97,"context_line":"    ]"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_570aba27","line":95,"updated":"2015-08-27 12:47:07.000000000","message":"Ditto this help text.","commit_id":"8070bbe056141c43c248c4a8bb704430bc3e38e7"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"f3577a415d646f92ad26d1f392ab2dd09f7abbe3","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    cfg.StrOpt(\u0027remap_vbd_dev_prefix\u0027,"},{"line_number":93,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":94,"context_line":"               deprecated_for_removal\u003dTrue,"},{"line_number":95,"context_line":"               help\u003d\u0027Specify prefix to remap VBD dev to \u0027"},{"line_number":96,"context_line":"                    \u0027(ex. /dev/xvdb -\u003e /dev/sdb)\u0027),"},{"line_number":97,"context_line":"    ]"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_d199d16f","line":95,"in_reply_to":"da20952f_570aba27","updated":"2015-08-28 03:19:35.000000000","message":"yes, will done","commit_id":"8070bbe056141c43c248c4a8bb704430bc3e38e7"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"a2f7d0f3bdd1b32af7ad9ab6140b6f0cd35bf14c","unresolved":false,"context_lines":[{"line_number":93,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":94,"context_line":"               deprecated_for_removal\u003dTrue,"},{"line_number":95,"context_line":"               help\u003d\u0027DEPRECATED: This option is ignored as the VBD \u0027"},{"line_number":96,"context_line":"                    \u0027path is determined automatically\u0027),"},{"line_number":97,"context_line":"    ]"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"CONF \u003d cfg.CONF"}],"source_content_type":"text/x-python","patch_set":21,"id":"7af24918_4b8db130","line":96,"range":{"start_line":96,"start_character":53,"end_line":96,"end_character":56},"updated":"2016-03-01 18:37:37.000000000","message":"deprecated_for_removal is applicable if the current code uses the conf values, and next release will delete them.\n\nYou are deleting all usage of these config parameters in this patch though. So deprecation serves no purpose - the config values are immediately useless to users.\n\nSO either you should deprecated the config params in Mitaka, and then change the code in Newton. Or you should just delete the config parameters \u0026 change the code all in Mitaka.\n\nGiven that this change is fixing a functional bug in current code, I\u0027d vote for just deleting the config parameters completely in Mitaka.","commit_id":"1387b68d6a9a131e0f898a718ba1d90b080f97b9"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"39d1f3f5981e95a222fe1b35fb21c4f0cd2d944a","unresolved":false,"context_lines":[{"line_number":93,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":94,"context_line":"               deprecated_for_removal\u003dTrue,"},{"line_number":95,"context_line":"               help\u003d\u0027DEPRECATED: This option is ignored as the VBD \u0027"},{"line_number":96,"context_line":"                    \u0027path is determined automatically\u0027),"},{"line_number":97,"context_line":"    ]"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"CONF \u003d cfg.CONF"}],"source_content_type":"text/x-python","patch_set":21,"id":"5aef4532_5c20f449","line":96,"range":{"start_line":96,"start_character":53,"end_line":96,"end_character":56},"in_reply_to":"7af24918_4b8db130","updated":"2016-03-07 11:03:49.000000000","message":"Done","commit_id":"1387b68d6a9a131e0f898a718ba1d90b080f97b9"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"ef0ae7a39d3ac557f6f90051c383c1e0c9a143d7","unresolved":false,"context_lines":[{"line_number":93,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":94,"context_line":"               deprecated_for_removal\u003dTrue,"},{"line_number":95,"context_line":"               help\u003d\u0027DEPRECATED: This option is ignored as the VBD \u0027"},{"line_number":96,"context_line":"                    \u0027path is determined automatically\u0027),"},{"line_number":97,"context_line":"    ]"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"CONF \u003d cfg.CONF"}],"source_content_type":"text/x-python","patch_set":21,"id":"7af24918_cd7afc76","line":96,"range":{"start_line":96,"start_character":53,"end_line":96,"end_character":56},"in_reply_to":"7af24918_4b8db130","updated":"2016-03-03 09:47:57.000000000","message":"OK - I thought nova would fail to start if invalid entries existed, but perhaps that behaviour has changed (or I was mistaken).\n\nWill remove the options and keep the reno.","commit_id":"1387b68d6a9a131e0f898a718ba1d90b080f97b9"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"39d1f3f5981e95a222fe1b35fb21c4f0cd2d944a","unresolved":false,"context_lines":[{"line_number":93,"context_line":"               default\u003d\u0027sd\u0027,"},{"line_number":94,"context_line":"               deprecated_for_removal\u003dTrue,"},{"line_number":95,"context_line":"               help\u003d\u0027DEPRECATED: This option is ignored as the VBD \u0027"},{"line_number":96,"context_line":"                    \u0027path is determined automatically\u0027),"},{"line_number":97,"context_line":"    ]"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"CONF \u003d cfg.CONF"}],"source_content_type":"text/x-python","patch_set":21,"id":"5aef4532_3c1d2810","line":96,"range":{"start_line":96,"start_character":53,"end_line":96,"end_character":56},"in_reply_to":"7af24918_cd7afc76","updated":"2016-03-07 11:03:49.000000000","message":"Done","commit_id":"1387b68d6a9a131e0f898a718ba1d90b080f97b9"}],"nova/virt/xenapi/vm_utils.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"fd7ded8430accb7401ba8b97af8dd4f416d5732d","unresolved":false,"context_lines":[{"line_number":2127,"context_line":""},{"line_number":2128,"context_line":"def _wait_for_device(dev):"},{"line_number":2129,"context_line":"    \"\"\"Wait for device node to appear.\"\"\""},{"line_number":2130,"context_line":"    "},{"line_number":2131,"context_line":"    dom_id, _ \u003d utils.execute(\u0027xenstore-read\u0027, \u0027domid\u0027, run_as_root\u003dTrue)"},{"line_number":2132,"context_line":"    backend_vbd \u003d \u0027/local/domain/\u0027 + dom_id.strip() + \u0027/device/vbd/\u0027"},{"line_number":2133,"context_line":"    vbd_path_list \u003d commands.getoutput(\u0027ls -d /sys/devices/vbd-*\u0027).split(\u0027\\n\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_d2d6e9f0","line":2130,"updated":"2015-08-14 12:28:16.000000000","message":"Remove whitespace","commit_id":"0da64848f2b1f8a8072a648862a2ada2d1264f5c"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"fd7ded8430accb7401ba8b97af8dd4f416d5732d","unresolved":false,"context_lines":[{"line_number":2141,"context_line":"        vdi_info, _ \u003d utils.execute(\u0027xenstore-read\u0027, vdi_path, run_as_root\u003dTrue)"},{"line_number":2142,"context_line":"        LOG.debug(\u0027vdi: %(vdi_uuid)s, %(vdi_path)s, vdi_info: %(vdi_info)s.\u0027,"},{"line_number":2143,"context_line":"                  {\u0027vdi_uuid\u0027 : vdi_uuid, \u0027vdi_path\u0027 : vdi_path, \u0027vdi_info\u0027 : vdi_info})"},{"line_number":2144,"context_line":"        if vdi_info.find(vdi_uuid) \u003e -1:"},{"line_number":2145,"context_line":"            dev_tmp \u003d commands.getoutput(\u0027ls \u0027 + vbd_path + \u0027/block\u0027)"},{"line_number":2146,"context_line":"            for i in range(0, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2147,"context_line":"                dev \u003d utils.make_dev_path(dev_tmp)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_32cf0d2b","line":2144,"updated":"2015-08-14 12:28:16.000000000","message":"I would rather the next block was not in the for loop.  We should find the correct UUID, then we know we have the VBD path.  Then we can finish the for loop\n\nRaise an exception if we don\u0027t find the vdi_uuid (otherwise it looks like a Timeout, below)\n\nThen, in the normal flow, we have the path and can wait for the device to exist.","commit_id":"0da64848f2b1f8a8072a648862a2ada2d1264f5c"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"fd7ded8430accb7401ba8b97af8dd4f416d5732d","unresolved":false,"context_lines":[{"line_number":2142,"context_line":"        LOG.debug(\u0027vdi: %(vdi_uuid)s, %(vdi_path)s, vdi_info: %(vdi_info)s.\u0027,"},{"line_number":2143,"context_line":"                  {\u0027vdi_uuid\u0027 : vdi_uuid, \u0027vdi_path\u0027 : vdi_path, \u0027vdi_info\u0027 : vdi_info})"},{"line_number":2144,"context_line":"        if vdi_info.find(vdi_uuid) \u003e -1:"},{"line_number":2145,"context_line":"            dev_tmp \u003d commands.getoutput(\u0027ls \u0027 + vbd_path + \u0027/block\u0027)"},{"line_number":2146,"context_line":"            for i in range(0, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2147,"context_line":"                dev \u003d utils.make_dev_path(dev_tmp)"},{"line_number":2148,"context_line":"                if os.path.exists(dev):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_52ebb978","line":2145,"updated":"2015-08-14 12:28:16.000000000","message":"Can we use python file handling rather than executing ls?\nWorth logging the name of the device we are now waiting for.","commit_id":"0da64848f2b1f8a8072a648862a2ada2d1264f5c"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"fd7ded8430accb7401ba8b97af8dd4f416d5732d","unresolved":false,"context_lines":[{"line_number":2144,"context_line":"        if vdi_info.find(vdi_uuid) \u003e -1:"},{"line_number":2145,"context_line":"            dev_tmp \u003d commands.getoutput(\u0027ls \u0027 + vbd_path + \u0027/block\u0027)"},{"line_number":2146,"context_line":"            for i in range(0, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2147,"context_line":"                dev \u003d utils.make_dev_path(dev_tmp)"},{"line_number":2148,"context_line":"                if os.path.exists(dev):"},{"line_number":2149,"context_line":"                    return dev"},{"line_number":2150,"context_line":"                time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_d28ee9cf","line":2147,"updated":"2015-08-14 12:28:16.000000000","message":"This doesn\u0027t change in the for loop so should occur before the loop","commit_id":"0da64848f2b1f8a8072a648862a2ada2d1264f5c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"20c71412a55222bee0d6d3784dc182df90db02b8","unresolved":false,"context_lines":[{"line_number":2119,"context_line":"    raise exception.NovaException(msg)"},{"line_number":2120,"context_line":""},{"line_number":2121,"context_line":""},{"line_number":2122,"context_line":"def _wait_for_device(vdi_uuid):"},{"line_number":2123,"context_line":"    \"\"\"Wait for device node to appear.\"\"\""},{"line_number":2124,"context_line":""},{"line_number":2125,"context_line":"    dom_id, _ \u003d utils.execute(\u0027xenstore-read\u0027, \u0027domid\u0027, run_as_root\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_9c4e8536","line":2122,"updated":"2015-09-07 12:47:52.000000000","message":"I don\u0027t see a unit test for this function, can you please add one?","commit_id":"0828d55136510e2fcda13681ea170ad62c6bcd23"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"3a149798312fb8024d0fc66c43c762ed44648fa2","unresolved":false,"context_lines":[{"line_number":2119,"context_line":"    raise exception.NovaException(msg)"},{"line_number":2120,"context_line":""},{"line_number":2121,"context_line":""},{"line_number":2122,"context_line":"def _wait_for_device(vdi_uuid):"},{"line_number":2123,"context_line":"    \"\"\"Wait for device node to appear.\"\"\""},{"line_number":2124,"context_line":""},{"line_number":2125,"context_line":"    dom_id, _ \u003d utils.execute(\u0027xenstore-read\u0027, \u0027domid\u0027, run_as_root\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_e9f17c96","line":2122,"in_reply_to":"da20952f_9c4e8536","updated":"2015-09-10 11:46:03.000000000","message":"yes, I can add unit test for this function","commit_id":"0828d55136510e2fcda13681ea170ad62c6bcd23"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"20c71412a55222bee0d6d3784dc182df90db02b8","unresolved":false,"context_lines":[{"line_number":2127,"context_line":"    vbd_path_list \u003d glob.glob(\u0027/sys/devices/vbd-*\u0027)"},{"line_number":2128,"context_line":""},{"line_number":2129,"context_line":"    # loop /sys/devices/vbd-* to find the correct vbd path"},{"line_number":2130,"context_line":"    found_vbd_path \u003d False"},{"line_number":2131,"context_line":"    for vbd_path in vbd_path_list:"},{"line_number":2132,"context_line":"        device_id \u003d vbd_path.split(\u0027-\u0027)[1]"},{"line_number":2133,"context_line":"        backend_path \u003d backend_vbd + device_id.strip() + \u0027/backend\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_9cb20548","line":2130,"updated":"2015-09-07 12:47:52.000000000","message":"can we not pull this out into a separate function, so this is easier to understand and test?","commit_id":"0828d55136510e2fcda13681ea170ad62c6bcd23"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"3a149798312fb8024d0fc66c43c762ed44648fa2","unresolved":false,"context_lines":[{"line_number":2127,"context_line":"    vbd_path_list \u003d glob.glob(\u0027/sys/devices/vbd-*\u0027)"},{"line_number":2128,"context_line":""},{"line_number":2129,"context_line":"    # loop /sys/devices/vbd-* to find the correct vbd path"},{"line_number":2130,"context_line":"    found_vbd_path \u003d False"},{"line_number":2131,"context_line":"    for vbd_path in vbd_path_list:"},{"line_number":2132,"context_line":"        device_id \u003d vbd_path.split(\u0027-\u0027)[1]"},{"line_number":2133,"context_line":"        backend_path \u003d backend_vbd + device_id.strip() + \u0027/backend\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_69e6cce9","line":2130,"in_reply_to":"da20952f_9cb20548","updated":"2015-09-10 11:46:03.000000000","message":"Sure, I will do this","commit_id":"0828d55136510e2fcda13681ea170ad62c6bcd23"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"ede0b237fec8bc2469458588a37f2cf1ae2dacfb","unresolved":false,"context_lines":[{"line_number":2132,"context_line":"    for vbd_path in vbd_path_list:"},{"line_number":2133,"context_line":"        device_id \u003d vbd_path.split(\u0027-\u0027)[1]"},{"line_number":2134,"context_line":"        backend_path \u003d backend_vbd + device_id.strip() + \u0027/backend\u0027"},{"line_number":2135,"context_line":"        vdi_path, _ \u003d utils.execute("},{"line_number":2136,"context_line":"            \u0027xenstore-read\u0027, backend_path, run_as_root\u003dTrue)"},{"line_number":2137,"context_line":"        vdi_path \u003d vdi_path.strip() + \u0027/vdi\u0027"},{"line_number":2138,"context_line":"        vdi_info, _ \u003d utils.execute("}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_f0e592a3","line":2135,"updated":"2015-09-17 11:14:56.000000000","message":"Tolerate failures here since there is a race condition","commit_id":"7620b58c861eebfd93db42efeda9a58afcef3714"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"ede0b237fec8bc2469458588a37f2cf1ae2dacfb","unresolved":false,"context_lines":[{"line_number":2143,"context_line":"        if vdi_info.find(vdi_uuid) \u003e -1:"},{"line_number":2144,"context_line":"            return vbd_path"},{"line_number":2145,"context_line":""},{"line_number":2146,"context_line":"    raise exception.StorageError(\"Cannot find correct vbd path\")"},{"line_number":2147,"context_line":""},{"line_number":2148,"context_line":""},{"line_number":2149,"context_line":"def _wait_for_device(vbd_path):"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_b004fa49","line":2146,"updated":"2015-09-17 11:14:56.000000000","message":"return None here, not an exception","commit_id":"7620b58c861eebfd93db42efeda9a58afcef3714"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"ede0b237fec8bc2469458588a37f2cf1ae2dacfb","unresolved":false,"context_lines":[{"line_number":2146,"context_line":"    raise exception.StorageError(\"Cannot find correct vbd path\")"},{"line_number":2147,"context_line":""},{"line_number":2148,"context_line":""},{"line_number":2149,"context_line":"def _wait_for_device(vbd_path):"},{"line_number":2150,"context_line":"    \"\"\"Wait for device node to appear.\"\"\""},{"line_number":2151,"context_line":""},{"line_number":2152,"context_line":"    # wait for dev under /sys/devices/vdb-*/block to be ready"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_d0016e39","line":2149,"updated":"2015-09-17 11:14:56.000000000","message":"take vdi_uuid","commit_id":"7620b58c861eebfd93db42efeda9a58afcef3714"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"ede0b237fec8bc2469458588a37f2cf1ae2dacfb","unresolved":false,"context_lines":[{"line_number":2148,"context_line":""},{"line_number":2149,"context_line":"def _wait_for_device(vbd_path):"},{"line_number":2150,"context_line":"    \"\"\"Wait for device node to appear.\"\"\""},{"line_number":2151,"context_line":""},{"line_number":2152,"context_line":"    # wait for dev under /sys/devices/vdb-*/block to be ready"},{"line_number":2153,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"},{"line_number":2154,"context_line":"    dev_ready \u003d False"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_d0af2e28","line":2151,"updated":"2015-09-17 11:14:56.000000000","message":"Convert vdi_uuid to vbd_path with:\nfor i in range (0, ...):\n    vbd_path \u003d _get_vbd_path(vdi_uuid)\n    if vbd_path:\n        break\n    time.sleep(1)","commit_id":"7620b58c861eebfd93db42efeda9a58afcef3714"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"ede0b237fec8bc2469458588a37f2cf1ae2dacfb","unresolved":false,"context_lines":[{"line_number":2167,"context_line":"    # wait for device node to be created"},{"line_number":2168,"context_line":"    dev \u003d utils.make_dev_path(dev_tmp)"},{"line_number":2169,"context_line":"    LOG.debug(\u0027Wait for device %s to be created\u0027, dev)"},{"line_number":2170,"context_line":"    for j in range(i, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2171,"context_line":"        if os.path.exists(dev):"},{"line_number":2172,"context_line":"            return dev"},{"line_number":2173,"context_line":"        time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_304c6a9d","line":2170,"updated":"2015-09-17 11:14:56.000000000","message":"I think we can re-use i here?\nfor i in range(i, CONF....)","commit_id":"7620b58c861eebfd93db42efeda9a58afcef3714"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"330f193abf475a4dfcaf4c292b7206fe1adb3066","unresolved":false,"context_lines":[{"line_number":2151,"context_line":"def _wait_for_device(vbd_path):"},{"line_number":2152,"context_line":"    \"\"\"Wait for device node to appear.\"\"\""},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"    # wait for dev under /sys/devices/vdb-*/block to be ready"},{"line_number":2155,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"},{"line_number":2156,"context_line":"    dev_ready \u003d False"},{"line_number":2157,"context_line":"    for i in range(0, CONF.xenserver.block_device_creation_timeout):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_42d9df55","line":2154,"range":{"start_line":2154,"start_character":38,"end_line":2154,"end_character":41},"updated":"2015-09-18 13:01:54.000000000","message":"vbd?","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"13485fabcb6d624b02744c019306baccc5e00e76","unresolved":false,"context_lines":[{"line_number":2151,"context_line":"def _wait_for_device(vbd_path):"},{"line_number":2152,"context_line":"    \"\"\"Wait for device node to appear.\"\"\""},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"    # wait for dev under /sys/devices/vdb-*/block to be ready"},{"line_number":2155,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"},{"line_number":2156,"context_line":"    dev_ready \u003d False"},{"line_number":2157,"context_line":"    for i in range(0, CONF.xenserver.block_device_creation_timeout):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_64174c45","line":2154,"in_reply_to":"ba15a1d1_42d9df55","updated":"2015-09-18 14:29:21.000000000","message":"VBD is a XenServer term - Virtual Block Device.","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"ae98e3da146549f96171741cec8b29417e3fd3b4","unresolved":false,"context_lines":[{"line_number":2151,"context_line":"def _wait_for_device(vbd_path):"},{"line_number":2152,"context_line":"    \"\"\"Wait for device node to appear.\"\"\""},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"    # wait for dev under /sys/devices/vdb-*/block to be ready"},{"line_number":2155,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"},{"line_number":2156,"context_line":"    dev_ready \u003d False"},{"line_number":2157,"context_line":"    for i in range(0, CONF.xenserver.block_device_creation_timeout):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_64fd0cb0","line":2154,"in_reply_to":"ba15a1d1_64174c45","updated":"2015-09-18 14:35:05.000000000","message":"Thanks Bob - I meant that the comment has a typo, it says VDB","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"31f66fdcaed38aed0b0bbed8b102b5a4c7568d11","unresolved":false,"context_lines":[{"line_number":2151,"context_line":"def _wait_for_device(vbd_path):"},{"line_number":2152,"context_line":"    \"\"\"Wait for device node to appear.\"\"\""},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"    # wait for dev under /sys/devices/vdb-*/block to be ready"},{"line_number":2155,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"},{"line_number":2156,"context_line":"    dev_ready \u003d False"},{"line_number":2157,"context_line":"    for i in range(0, CONF.xenserver.block_device_creation_timeout):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_7f4a51ae","line":2154,"in_reply_to":"ba15a1d1_64fd0cb0","updated":"2015-09-21 02:09:52.000000000","message":"Yes,I will modify the comment","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"330f193abf475a4dfcaf4c292b7206fe1adb3066","unresolved":false,"context_lines":[{"line_number":2157,"context_line":"    for i in range(0, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2158,"context_line":"        dev_list \u003d os.listdir(block_path)"},{"line_number":2159,"context_line":"        if len(dev_list) \u003e 0:"},{"line_number":2160,"context_line":"            dev_tmp \u003d dev_list.pop()"},{"line_number":2161,"context_line":"            dev_ready \u003d True"},{"line_number":2162,"context_line":"            break"},{"line_number":2163,"context_line":"        time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_e2e593db","line":2160,"range":{"start_line":2160,"start_character":31,"end_line":2160,"end_character":34},"updated":"2015-09-18 13:01:54.000000000","message":"why use pop (which modifies the receiver) when you don\u0027t check dev_list again? It\u0027d be more minimal to use dev_list[-1].","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"31f66fdcaed38aed0b0bbed8b102b5a4c7568d11","unresolved":false,"context_lines":[{"line_number":2157,"context_line":"    for i in range(0, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2158,"context_line":"        dev_list \u003d os.listdir(block_path)"},{"line_number":2159,"context_line":"        if len(dev_list) \u003e 0:"},{"line_number":2160,"context_line":"            dev_tmp \u003d dev_list.pop()"},{"line_number":2161,"context_line":"            dev_ready \u003d True"},{"line_number":2162,"context_line":"            break"},{"line_number":2163,"context_line":"        time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_5f574d26","line":2160,"in_reply_to":"ba15a1d1_c41e585e","updated":"2015-09-21 02:09:52.000000000","message":"Yes, I will change this.","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"13485fabcb6d624b02744c019306baccc5e00e76","unresolved":false,"context_lines":[{"line_number":2157,"context_line":"    for i in range(0, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2158,"context_line":"        dev_list \u003d os.listdir(block_path)"},{"line_number":2159,"context_line":"        if len(dev_list) \u003e 0:"},{"line_number":2160,"context_line":"            dev_tmp \u003d dev_list.pop()"},{"line_number":2161,"context_line":"            dev_ready \u003d True"},{"line_number":2162,"context_line":"            break"},{"line_number":2163,"context_line":"        time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_c41e585e","line":2160,"in_reply_to":"ba15a1d1_e2e593db","updated":"2015-09-18 14:29:21.000000000","message":"Agreed.","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"31f66fdcaed38aed0b0bbed8b102b5a4c7568d11","unresolved":false,"context_lines":[{"line_number":2157,"context_line":"    for i in range(0, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2158,"context_line":"        dev_list \u003d os.listdir(block_path)"},{"line_number":2159,"context_line":"        if len(dev_list) \u003e 0:"},{"line_number":2160,"context_line":"            dev_tmp \u003d dev_list.pop()"},{"line_number":2161,"context_line":"            dev_ready \u003d True"},{"line_number":2162,"context_line":"            break"},{"line_number":2163,"context_line":"        time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_9f5de54a","line":2160,"in_reply_to":"ba15a1d1_e2e593db","updated":"2015-09-21 02:09:52.000000000","message":"Yes, should not use pop()","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"330f193abf475a4dfcaf4c292b7206fe1adb3066","unresolved":false,"context_lines":[{"line_number":2162,"context_line":"            break"},{"line_number":2163,"context_line":"        time.sleep(1)"},{"line_number":2164,"context_line":""},{"line_number":2165,"context_line":"    if not dev_ready:"},{"line_number":2166,"context_line":"        raise exception.StorageError(reason \u003d"},{"line_number":2167,"context_line":"            _(\"Timeout waiting for dev under %s to be ready\") % block_path)"},{"line_number":2168,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_a27f9b13","line":2165,"updated":"2015-09-18 13:01:54.000000000","message":"instead of dev_ready, you could use an \"else\" on the \"for\".","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"13485fabcb6d624b02744c019306baccc5e00e76","unresolved":false,"context_lines":[{"line_number":2164,"context_line":""},{"line_number":2165,"context_line":"    if not dev_ready:"},{"line_number":2166,"context_line":"        raise exception.StorageError(reason \u003d"},{"line_number":2167,"context_line":"            _(\"Timeout waiting for dev under %s to be ready\") % block_path)"},{"line_number":2168,"context_line":""},{"line_number":2169,"context_line":"    # wait for device node to be created"},{"line_number":2170,"context_line":"    dev \u003d utils.make_dev_path(dev_tmp)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_e4583c33","line":2167,"updated":"2015-09-18 14:29:21.000000000","message":"I believe we can\u0027t add new exceptions at this point as we\u0027re past StringFreeze.\nPlease re-use the \u0027Timeout waiting for device %s to be created\"","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"31f66fdcaed38aed0b0bbed8b102b5a4c7568d11","unresolved":false,"context_lines":[{"line_number":2164,"context_line":""},{"line_number":2165,"context_line":"    if not dev_ready:"},{"line_number":2166,"context_line":"        raise exception.StorageError(reason \u003d"},{"line_number":2167,"context_line":"            _(\"Timeout waiting for dev under %s to be ready\") % block_path)"},{"line_number":2168,"context_line":""},{"line_number":2169,"context_line":"    # wait for device node to be created"},{"line_number":2170,"context_line":"    dev \u003d utils.make_dev_path(dev_tmp)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_913399f6","line":2167,"in_reply_to":"ba15a1d1_e4583c33","updated":"2015-09-21 02:09:52.000000000","message":"Got your concern now, I will change this, thanks a lot.\nAnd I should not raise a new exception at _get_vbd_path(), right?","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"330f193abf475a4dfcaf4c292b7206fe1adb3066","unresolved":false,"context_lines":[{"line_number":2169,"context_line":"    # wait for device node to be created"},{"line_number":2170,"context_line":"    dev \u003d utils.make_dev_path(dev_tmp)"},{"line_number":2171,"context_line":"    LOG.debug(\u0027Wait for device %s to be created\u0027, dev)"},{"line_number":2172,"context_line":"    for j in range(i, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2173,"context_line":"        if os.path.exists(dev):"},{"line_number":2174,"context_line":"            return dev"},{"line_number":2175,"context_line":"        time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_a2423bac","line":2172,"updated":"2015-09-18 13:01:54.000000000","message":"-1: we\u0027re now waiting up to 2x the given timeout, I\u0027m not sure that\u0027s OK","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"ae98e3da146549f96171741cec8b29417e3fd3b4","unresolved":false,"context_lines":[{"line_number":2169,"context_line":"    # wait for device node to be created"},{"line_number":2170,"context_line":"    dev \u003d utils.make_dev_path(dev_tmp)"},{"line_number":2171,"context_line":"    LOG.debug(\u0027Wait for device %s to be created\u0027, dev)"},{"line_number":2172,"context_line":"    for j in range(i, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2173,"context_line":"        if os.path.exists(dev):"},{"line_number":2174,"context_line":"            return dev"},{"line_number":2175,"context_line":"        time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_e4defc3c","line":2172,"in_reply_to":"ba15a1d1_047770a0","updated":"2015-09-18 14:35:05.000000000","message":"Ahh good spot, thanks","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"13485fabcb6d624b02744c019306baccc5e00e76","unresolved":false,"context_lines":[{"line_number":2169,"context_line":"    # wait for device node to be created"},{"line_number":2170,"context_line":"    dev \u003d utils.make_dev_path(dev_tmp)"},{"line_number":2171,"context_line":"    LOG.debug(\u0027Wait for device %s to be created\u0027, dev)"},{"line_number":2172,"context_line":"    for j in range(i, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2173,"context_line":"        if os.path.exists(dev):"},{"line_number":2174,"context_line":"            return dev"},{"line_number":2175,"context_line":"        time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_047770a0","line":2172,"in_reply_to":"ba15a1d1_a2423bac","updated":"2015-09-18 14:29:21.000000000","message":"We\u0027re not; this is going from range i .. timeout where \u0027i\u0027 is the count from the previous loop","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"330f193abf475a4dfcaf4c292b7206fe1adb3066","unresolved":false,"context_lines":[{"line_number":2175,"context_line":"        time.sleep(1)"},{"line_number":2176,"context_line":""},{"line_number":2177,"context_line":"    raise exception.StorageError("},{"line_number":2178,"context_line":"        reason \u003d _(\"Timeout waiting for device %s to be created\") % dev)"},{"line_number":2179,"context_line":""},{"line_number":2180,"context_line":""},{"line_number":2181,"context_line":"def cleanup_attached_vdis(session):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_c2240f0e","line":2178,"range":{"start_line":2178,"start_character":14,"end_line":2178,"end_character":17},"updated":"2015-09-18 13:01:54.000000000","message":"femtonit: usually we don\u0027t put spaces around kwarg \u003d","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"31f66fdcaed38aed0b0bbed8b102b5a4c7568d11","unresolved":false,"context_lines":[{"line_number":2175,"context_line":"        time.sleep(1)"},{"line_number":2176,"context_line":""},{"line_number":2177,"context_line":"    raise exception.StorageError("},{"line_number":2178,"context_line":"        reason \u003d _(\"Timeout waiting for device %s to be created\") % dev)"},{"line_number":2179,"context_line":""},{"line_number":2180,"context_line":""},{"line_number":2181,"context_line":"def cleanup_attached_vdis(session):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba15a1d1_3f993920","line":2178,"in_reply_to":"ba15a1d1_c2240f0e","updated":"2015-09-21 02:09:52.000000000","message":"I will remove these spaces","commit_id":"14945ee6f59b8feaf2774d9dfb91bf1288229d46"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"6f0cd9b0af7e8c714d32fdeadd2a0bf007d698a0","unresolved":false,"context_lines":[{"line_number":2159,"context_line":"            break"},{"line_number":2160,"context_line":"        time.sleep(1)"},{"line_number":2161,"context_line":""},{"line_number":2162,"context_line":"    if not vbd_path:"},{"line_number":2163,"context_line":"        raise exception.StorageError("},{"line_number":2164,"context_line":"            \"Timeout waiting for device %s to be created\" % \u0027vbd\u0027)"},{"line_number":2165,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"ba15a1d1_f66be3ef","line":2162,"updated":"2015-09-21 13:02:17.000000000","message":"Any reason not to do this? Bit of a nit but for/else exists for just this purpose, may as well use it. It means you don\u0027t have to duplicate the condition.\n\n  for i in range(0, CONF.xenserver.block_device_creation_timeout):\n    vbd_path \u003d _get_vbd_path(vdi_uuid)\n    if vbd_path:\n      break\n    time.sleep(1)\n  else:\n    raise exception.StorageError(\n        \"Timeout waiting for device %s to be created\" % \u0027vbd\u0027)","commit_id":"921375b17377e8cd5bc4ff8846676839783f4a5c"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"bbff80f6ba89cf63b26e3e0e20396891f83dc1a6","unresolved":false,"context_lines":[{"line_number":2159,"context_line":"            break"},{"line_number":2160,"context_line":"        time.sleep(1)"},{"line_number":2161,"context_line":""},{"line_number":2162,"context_line":"    if not vbd_path:"},{"line_number":2163,"context_line":"        raise exception.StorageError("},{"line_number":2164,"context_line":"            \"Timeout waiting for device %s to be created\" % \u0027vbd\u0027)"},{"line_number":2165,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"ba15a1d1_0a5c997b","line":2162,"in_reply_to":"ba15a1d1_f66be3ef","updated":"2015-09-24 01:59:47.000000000","message":"ah, thanks for your detailed example, got your meaning now clearly.\nSorry that I don\u0027t understand your though with previous comments.\nWill change to keep the code neat and comfortable.","commit_id":"921375b17377e8cd5bc4ff8846676839783f4a5c"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"fa3b256b9f509ce865b40befbfbbd0ac11e05d83","unresolved":false,"context_lines":[{"line_number":2161,"context_line":""},{"line_number":2162,"context_line":"    if not vbd_path:"},{"line_number":2163,"context_line":"        raise exception.StorageError("},{"line_number":2164,"context_line":"            \"Timeout waiting for device %s to be created\" % \u0027vbd\u0027)"},{"line_number":2165,"context_line":""},{"line_number":2166,"context_line":"    # wait for dev under /sys/devices/vbd-*/block to be ready"},{"line_number":2167,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba15a1d1_ee707942","line":2164,"updated":"2015-09-23 11:43:43.000000000","message":"I\u0027m confused about the strings now:  This should be translated - use _(\u003cstring\u003e) - but I thought the string should also be a parameter to the translated text, rather than substituted in before translation (which is what % would do).\nI\u0027d like someone else\u0027s view on how to handle the exceptions here.","commit_id":"921375b17377e8cd5bc4ff8846676839783f4a5c"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"bbff80f6ba89cf63b26e3e0e20396891f83dc1a6","unresolved":false,"context_lines":[{"line_number":2161,"context_line":""},{"line_number":2162,"context_line":"    if not vbd_path:"},{"line_number":2163,"context_line":"        raise exception.StorageError("},{"line_number":2164,"context_line":"            \"Timeout waiting for device %s to be created\" % \u0027vbd\u0027)"},{"line_number":2165,"context_line":""},{"line_number":2166,"context_line":"    # wait for dev under /sys/devices/vbd-*/block to be ready"},{"line_number":2167,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba15a1d1_e505d60f","line":2164,"in_reply_to":"ba15a1d1_ee707942","updated":"2015-09-24 01:59:47.000000000","message":"me too, my previous understanding is the param string do not need to be translated. But I\u0027m not sure about details of internationalization.\nI will try to find some hints on the internet","commit_id":"921375b17377e8cd5bc4ff8846676839783f4a5c"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"6f0cd9b0af7e8c714d32fdeadd2a0bf007d698a0","unresolved":false,"context_lines":[{"line_number":2174,"context_line":"        dev_tmp \u003d None"},{"line_number":2175,"context_line":"        time.sleep(1)"},{"line_number":2176,"context_line":""},{"line_number":2177,"context_line":"    if not dev_tmp:"},{"line_number":2178,"context_line":"        raise exception.StorageError(reason\u003d"},{"line_number":2179,"context_line":"            _(\"Timeout waiting for device %s to be created\") % block_path)"},{"line_number":2180,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"ba15a1d1_f6420368","line":2177,"updated":"2015-09-21 13:02:17.000000000","message":"This could be a for/else too","commit_id":"921375b17377e8cd5bc4ff8846676839783f4a5c"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"bbff80f6ba89cf63b26e3e0e20396891f83dc1a6","unresolved":false,"context_lines":[{"line_number":2174,"context_line":"        dev_tmp \u003d None"},{"line_number":2175,"context_line":"        time.sleep(1)"},{"line_number":2176,"context_line":""},{"line_number":2177,"context_line":"    if not dev_tmp:"},{"line_number":2178,"context_line":"        raise exception.StorageError(reason\u003d"},{"line_number":2179,"context_line":"            _(\"Timeout waiting for device %s to be created\") % block_path)"},{"line_number":2180,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"ba15a1d1_651a2671","line":2177,"in_reply_to":"ba15a1d1_f6420368","updated":"2015-09-24 01:59:47.000000000","message":"Yes, will change these","commit_id":"921375b17377e8cd5bc4ff8846676839783f4a5c"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"6dbf655f6f9705a4f3c6704d06e0363ec78edd59","unresolved":false,"context_lines":[{"line_number":2159,"context_line":"        time.sleep(1)"},{"line_number":2160,"context_line":"    else:"},{"line_number":2161,"context_line":"        raise exception.StorageError("},{"line_number":2162,"context_line":"            \"Timeout waiting for device %s to be created\" % \u0027vbd\u0027)"},{"line_number":2163,"context_line":""},{"line_number":2164,"context_line":"    # wait for dev under /sys/devices/vbd-*/block to be ready"},{"line_number":2165,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba15a1d1_45ad90e7","line":2162,"range":{"start_line":2162,"start_character":57,"end_line":2162,"end_character":59},"updated":"2015-09-24 12:30:54.000000000","message":"ah I understand Bob\u0027s point now. This should be:\n\n  raise exception.StorageError(_(\n    \"Timeout waiting for device %s to be created\") % vbd_path)\n\nThe translation should also contain %s, in an appropriate place, so % will work. See: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-translated-messages\nFor logs we want to delay interpolation so those are passed to the logging function: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages\n\nNot sure why you had the literal \u0027vbd\u0027 :)\n\nI picked _ instead of _LE after referring to: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#choosing-a-marker-function","commit_id":"a58a23899bb693833f8a2db5f0d9521545acc8e3"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"1498b1feecf58b995e24b06ee2f064cdbccd6aab","unresolved":false,"context_lines":[{"line_number":2159,"context_line":"        time.sleep(1)"},{"line_number":2160,"context_line":"    else:"},{"line_number":2161,"context_line":"        raise exception.StorageError("},{"line_number":2162,"context_line":"            \"Timeout waiting for device %s to be created\" % \u0027vbd\u0027)"},{"line_number":2163,"context_line":""},{"line_number":2164,"context_line":"    # wait for dev under /sys/devices/vbd-*/block to be ready"},{"line_number":2165,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a1a9d01_e444511c","line":2162,"in_reply_to":"9a1a9d01_a89ba271","updated":"2015-09-28 08:47:24.000000000","message":"Doh! Thanks for explaining. You still need to add the _() around the message.","commit_id":"a58a23899bb693833f8a2db5f0d9521545acc8e3"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"2ada7632ceb1f06edcd307b17f2d5ec0031dc034","unresolved":false,"context_lines":[{"line_number":2159,"context_line":"        time.sleep(1)"},{"line_number":2160,"context_line":"    else:"},{"line_number":2161,"context_line":"        raise exception.StorageError("},{"line_number":2162,"context_line":"            \"Timeout waiting for device %s to be created\" % \u0027vbd\u0027)"},{"line_number":2163,"context_line":""},{"line_number":2164,"context_line":"    # wait for dev under /sys/devices/vbd-*/block to be ready"},{"line_number":2165,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a1a9d01_a89ba271","line":2162,"in_reply_to":"ba15a1d1_45ad90e7","updated":"2015-09-26 05:44:36.000000000","message":"ah, Thanks very much for giving me such detailed information about i18n:)\nI don\u0027t use variable \"vbd_path\" but literal \u0027vbd\u0027 just because when raising this exception, we know that value of \"vbd_path\" is None. But I want to keep the exception message in the same format with the original one before fixing this bug to avoid introducing new exception message. So I don\u0027t know how to do with None and just add \u0027vbd\u0027","commit_id":"a58a23899bb693833f8a2db5f0d9521545acc8e3"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"d1339246e25b3914b3920d310fc5aa89b03390fb","unresolved":false,"context_lines":[{"line_number":2132,"context_line":"    for vbd_path in vbd_path_list:"},{"line_number":2133,"context_line":"        device_id \u003d vbd_path.split(\u0027-\u0027)[1]"},{"line_number":2134,"context_line":"        backend_path \u003d backend_vbd + device_id.strip() + \u0027/backend\u0027"},{"line_number":2135,"context_line":"        vdi_path, _ \u003d utils.execute("},{"line_number":2136,"context_line":"            \u0027xenstore-read\u0027, backend_path, run_as_root\u003dTrue,"},{"line_number":2137,"context_line":"            delay_on_retry\u003dTrue, attempts\u003d5)"},{"line_number":2138,"context_line":"        vdi_path \u003d vdi_path.strip() + \u0027/vdi\u0027"}],"source_content_type":"text/x-python","patch_set":16,"id":"7a740942_0ac821a7","line":2135,"updated":"2015-12-08 08:28:58.000000000","message":"Need a \"try... except...\" in case reading from xenstore got exception","commit_id":"ad6d74d0131658958a8663ba8ac40cd16f350d9b"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"d1339246e25b3914b3920d310fc5aa89b03390fb","unresolved":false,"context_lines":[{"line_number":2136,"context_line":"            \u0027xenstore-read\u0027, backend_path, run_as_root\u003dTrue,"},{"line_number":2137,"context_line":"            delay_on_retry\u003dTrue, attempts\u003d5)"},{"line_number":2138,"context_line":"        vdi_path \u003d vdi_path.strip() + \u0027/vdi\u0027"},{"line_number":2139,"context_line":"        vdi_info, _ \u003d utils.execute("},{"line_number":2140,"context_line":"            \u0027xenstore-read\u0027, vdi_path, run_as_root\u003dTrue,"},{"line_number":2141,"context_line":"            delay_on_retry\u003dTrue, attempts\u003d5)"},{"line_number":2142,"context_line":"        LOG.debug(\u0027vdi: %(vdi_uuid)s, %(vdi_path)s, vdi_info: %(vdi_info)s.\u0027,"}],"source_content_type":"text/x-python","patch_set":16,"id":"7a740942_2acdddb6","line":2139,"updated":"2015-12-08 08:28:58.000000000","message":"ditto","commit_id":"ad6d74d0131658958a8663ba8ac40cd16f350d9b"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"e17234fdf89f407e62ba10cc3530210e4298ac69","unresolved":false,"context_lines":[{"line_number":2148,"context_line":"                return vbd_path"},{"line_number":2149,"context_line":"        except Exception:"},{"line_number":2150,"context_line":"            # continue next loop when getting vdi_path or vdi_info failed"},{"line_number":2151,"context_line":"            LOG.debug(\u0027Error while reading vdi info, vbd path is %s\u0027, vbd_path)"},{"line_number":2152,"context_line":"            continue"},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"    # No vbd found with specific vdi_uuid"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a740942_5c49105f","line":2151,"updated":"2015-12-08 11:06:04.000000000","message":"maybe not an error but just it\u0027s not ready?","commit_id":"ff275d7146f84742267d07233082766f1abc478e"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"0543c0e36e524b4a9a5f12ad7cc8473013b7c104","unresolved":false,"context_lines":[{"line_number":2148,"context_line":"                return vbd_path"},{"line_number":2149,"context_line":"        except Exception:"},{"line_number":2150,"context_line":"            # continue next loop when getting vdi_path or vdi_info failed"},{"line_number":2151,"context_line":"            LOG.debug(\u0027Error while reading vdi info, vbd path is %s\u0027, vbd_path)"},{"line_number":2152,"context_line":"            continue"},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"    # No vbd found with specific vdi_uuid"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a740942_9037544c","line":2151,"in_reply_to":"7a740942_309a20ba","updated":"2015-12-08 13:25:41.000000000","message":"I would say something like this?\nexn \u003d None\nfor in in range(0, ...):\n  try:\n    vbd_path \u003d _get_vbd_path(vdi_uuid)\n    if vbd_path:\n      break;\n    time.sleep(1)\n  except e:\n    exn \u003d e\nelse:\n  if e:\n    LOG.exception(\u0027Exception raised from get_vbd_path\u0027, e)\n  vbd_path \u003d \u0027vbd\u0027\n  ....","commit_id":"ff275d7146f84742267d07233082766f1abc478e"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"15872bb9852148489a1a79d666133c015cb1983c","unresolved":false,"context_lines":[{"line_number":2148,"context_line":"                return vbd_path"},{"line_number":2149,"context_line":"        except Exception:"},{"line_number":2150,"context_line":"            # continue next loop when getting vdi_path or vdi_info failed"},{"line_number":2151,"context_line":"            LOG.debug(\u0027Error while reading vdi info, vbd path is %s\u0027, vbd_path)"},{"line_number":2152,"context_line":"            continue"},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"    # No vbd found with specific vdi_uuid"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a740942_658228ca","line":2151,"in_reply_to":"7a740942_5c49105f","updated":"2015-12-08 13:10:00.000000000","message":"Think this is OK as it\u0027s just a debug logging rather than a LOG.error()\nHowever, we don\u0027t capture this exception.\n\nI think if it would be better to catch the exception in _wait_for_device below, and if an exception occurs in the last loop then log it fully?","commit_id":"ff275d7146f84742267d07233082766f1abc478e"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"69905d3c69ca108d9c860a97a43ea8b08b68b11e","unresolved":false,"context_lines":[{"line_number":2148,"context_line":"                return vbd_path"},{"line_number":2149,"context_line":"        except Exception:"},{"line_number":2150,"context_line":"            # continue next loop when getting vdi_path or vdi_info failed"},{"line_number":2151,"context_line":"            LOG.debug(\u0027Error while reading vdi info, vbd path is %s\u0027, vbd_path)"},{"line_number":2152,"context_line":"            continue"},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"    # No vbd found with specific vdi_uuid"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a740942_309a20ba","line":2151,"in_reply_to":"7a740942_658228ca","updated":"2015-12-08 13:19:38.000000000","message":"As my understanding, in _wait_for_device() function, use try .. except .. to enclose this function _get_vbd_path() and check local variable i, if it is last loop, then log it fully and raise, just like the else part in line:2166?","commit_id":"ff275d7146f84742267d07233082766f1abc478e"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"a12a50fdc3ae73e329c9eb2987b3760fcab332cd","unresolved":false,"context_lines":[{"line_number":2148,"context_line":"                return vbd_path"},{"line_number":2149,"context_line":"        except Exception:"},{"line_number":2150,"context_line":"            # continue next loop when getting vdi_path or vdi_info failed"},{"line_number":2151,"context_line":"            LOG.debug(\u0027Error while reading vdi info, vbd path is %s\u0027, vbd_path)"},{"line_number":2152,"context_line":"            continue"},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"    # No vbd found with specific vdi_uuid"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a740942_faff7263","line":2151,"in_reply_to":"7a740942_9037544c","updated":"2015-12-09 01:50:42.000000000","message":"Got your thought, thanks:). \nJust one thing, there may be many vbd(/sys/devices/vbd-*) when multi instances are booting concurently, we cannot know which is the right vbd, so we loop these vbd path and try to get the vdi infomation. If it failed during this operation(xenstore-read), we don\u0027t know whether it is just the vbd that we are looking for, maybe it is another vbd for another instance. In function _get_vbd_path(vdi_uuid) we have opportunity to catch the exception and continue next loop, but in _wait_for_device(), we just restart this at the beginner","commit_id":"ff275d7146f84742267d07233082766f1abc478e"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"fe387c0244ecc83630ec4391e5da2c3d7ae7f086","unresolved":false,"context_lines":[{"line_number":2148,"context_line":"                return vbd_path"},{"line_number":2149,"context_line":"        except Exception:"},{"line_number":2150,"context_line":"            # continue next loop when getting vdi_path or vdi_info failed"},{"line_number":2151,"context_line":"            LOG.debug(\u0027Error while reading vdi info, vbd path is %s\u0027, vbd_path)"},{"line_number":2152,"context_line":"            continue"},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"    # No vbd found with specific vdi_uuid"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a740942_51f8d6c4","line":2151,"in_reply_to":"7a740942_faff7263","updated":"2015-12-09 11:29:19.000000000","message":"OK - you\u0027ve convinced me.  I\u0027ll +1 the change :)","commit_id":"ff275d7146f84742267d07233082766f1abc478e"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"4730d980e62a23c737051b8919609730306d4936","unresolved":false,"context_lines":[{"line_number":2148,"context_line":"                return vbd_path"},{"line_number":2149,"context_line":"        except Exception:"},{"line_number":2150,"context_line":"            # continue next loop when getting vdi_path or vdi_info failed"},{"line_number":2151,"context_line":"            LOG.debug(\u0027Error while reading vdi info, vbd path is %s\u0027, vbd_path)"},{"line_number":2152,"context_line":"            continue"},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"    # No vbd found with specific vdi_uuid"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a740942_55a1b7f6","line":2151,"in_reply_to":"7a740942_faff7263","updated":"2015-12-09 02:10:39.000000000","message":"yes, I also have the concern about that. I don\u0027t think it\u0027s expected that this checking will be impacted by other vbd\u0027s existing. It will be another race condition. Let\u0027s image the worst case that it always has some not-ready VBDs in the whole looping; then it will timeout but indeed the target VBD has been ready.","commit_id":"ff275d7146f84742267d07233082766f1abc478e"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d341f36eefe0373a648fdf0216a5f661759bc80a","unresolved":false,"context_lines":[{"line_number":2160,"context_line":""},{"line_number":2161,"context_line":"    # loop to wait for backend/frontend get ready, avoid race condition"},{"line_number":2162,"context_line":"    for i in range(0, CONF.xenserver.block_device_creation_timeout):"},{"line_number":2163,"context_line":"        vbd_path \u003d _get_vbd_path(vdi_uuid)"},{"line_number":2164,"context_line":"        if vbd_path:"},{"line_number":2165,"context_line":"            break"},{"line_number":2166,"context_line":"        time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":18,"id":"da6ed579_dd403d0a","line":2163,"updated":"2016-01-12 08:23:58.000000000","message":"You still get a new domid on every loop, thats good.","commit_id":"69f356a268425441e9ea2b979269aebe4ccf5c42"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"17298b24fffbc049b93d1f4396fec17149adf9d2","unresolved":false,"context_lines":[{"line_number":2086,"context_line":"                       \u0027vdi_info\u0027: vdi_info})"},{"line_number":2087,"context_line":"            if vdi_info.find(vdi_uuid) \u003e -1:"},{"line_number":2088,"context_line":"                return vbd_path"},{"line_number":2089,"context_line":"        except Exception:"},{"line_number":2090,"context_line":"            # continue next loop when getting vdi_path or vdi_info failed"},{"line_number":2091,"context_line":"            LOG.debug(\u0027Error while reading vdi info, vbd path is %s\u0027, vbd_path)"},{"line_number":2092,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":26,"id":"9abb7d3a_854f246a","line":2089,"updated":"2016-05-31 13:58:32.000000000","message":"Surely we can come up with a better exception than this right? You could have coding errors in the above block that would be hidden by this.","commit_id":"f5b2316819f5e95d46101476cd7cb01b82a433b3"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"846896308695ab5cc6efaac5baca1c464722f9f6","unresolved":false,"context_lines":[{"line_number":2086,"context_line":"                       \u0027vdi_info\u0027: vdi_info})"},{"line_number":2087,"context_line":"            if vdi_info.find(vdi_uuid) \u003e -1:"},{"line_number":2088,"context_line":"                return vbd_path"},{"line_number":2089,"context_line":"        except Exception:"},{"line_number":2090,"context_line":"            # continue next loop when getting vdi_path or vdi_info failed"},{"line_number":2091,"context_line":"            LOG.debug(\u0027Error while reading vdi info, vbd path is %s\u0027, vbd_path)"},{"line_number":2092,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":26,"id":"3aaa91ec_a599ad70","line":2089,"in_reply_to":"3aaa91ec_18aad470","updated":"2016-06-29 02:57:36.000000000","message":"I see, I will check this","commit_id":"f5b2316819f5e95d46101476cd7cb01b82a433b3"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"1d68f55fcdb18fa864ff0a8b31cdeaa69c72efcc","unresolved":false,"context_lines":[{"line_number":2086,"context_line":"                       \u0027vdi_info\u0027: vdi_info})"},{"line_number":2087,"context_line":"            if vdi_info.find(vdi_uuid) \u003e -1:"},{"line_number":2088,"context_line":"                return vbd_path"},{"line_number":2089,"context_line":"        except Exception:"},{"line_number":2090,"context_line":"            # continue next loop when getting vdi_path or vdi_info failed"},{"line_number":2091,"context_line":"            LOG.debug(\u0027Error while reading vdi info, vbd path is %s\u0027, vbd_path)"},{"line_number":2092,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":26,"id":"3aaa91ec_18aad470","line":2089,"in_reply_to":"7aa08908_727db06c","updated":"2016-06-28 11:01:25.000000000","message":"It\u0027ll be an exception raised from utils.execute though which looks like it would raise processutils.ProcessExecutionError?","commit_id":"f5b2316819f5e95d46101476cd7cb01b82a433b3"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"03651617facd2d1f1931fe8cc268da961dd440f5","unresolved":false,"context_lines":[{"line_number":2086,"context_line":"                       \u0027vdi_info\u0027: vdi_info})"},{"line_number":2087,"context_line":"            if vdi_info.find(vdi_uuid) \u003e -1:"},{"line_number":2088,"context_line":"                return vbd_path"},{"line_number":2089,"context_line":"        except Exception:"},{"line_number":2090,"context_line":"            # continue next loop when getting vdi_path or vdi_info failed"},{"line_number":2091,"context_line":"            LOG.debug(\u0027Error while reading vdi info, vbd path is %s\u0027, vbd_path)"},{"line_number":2092,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_727db06c","line":2089,"in_reply_to":"9abb7d3a_854f246a","updated":"2016-06-17 10:29:19.000000000","message":"The exception here we want to deal with is the xenstore-read exception, which is not nova project related exception, but xenserver related, so I just use Exception instead of the detailed XXXException. \nThe other reason is during the loop, I don\u0027t know which vbd_path it the one that we want to find out, I want to loop all the vbd_path_lists to make sure I didn\u0027t miss anyone, so a generic exception is a bit better.","commit_id":"f5b2316819f5e95d46101476cd7cb01b82a433b3"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"71b65f19f3ef1886f3c21754dff85304da05926d","unresolved":false,"context_lines":[{"line_number":2182,"context_line":"        # set vbd_path a meaningful value since it is None now"},{"line_number":2183,"context_line":"        vbd_path \u003d \u0027vbd\u0027"},{"line_number":2184,"context_line":"        raise exception.StorageError(reason\u003d"},{"line_number":2185,"context_line":"            _(\"Timeout waiting for device %s to be created\") % vbd_path)"},{"line_number":2186,"context_line":""},{"line_number":2187,"context_line":"    # wait for dev under /sys/devices/vbd-*/block to be ready"},{"line_number":2188,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"1aa78d24_6efb8f48","line":2185,"updated":"2016-07-07 21:27:10.000000000","message":"Just curious, but why is a static string being passed in to this text here, as opposed to just replacing \u0027%s\u0027 with \u0027vbd\u0027 directly? Also, it may be more informative to either not say \u0027vbd\u0027 here (as that is a \u0027fake\u0027 value), or else output \u0027vdi_uuid\u0027 perhaps (or at least log it for ops to chew on)?","commit_id":"6bb662968a30241aac76c546b734532e30254699"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"c2949f2f8b3a5a3d8db20a4dd98eef35b4c4fa3e","unresolved":false,"context_lines":[{"line_number":2182,"context_line":"        # set vbd_path a meaningful value since it is None now"},{"line_number":2183,"context_line":"        vbd_path \u003d \u0027vbd\u0027"},{"line_number":2184,"context_line":"        raise exception.StorageError(reason\u003d"},{"line_number":2185,"context_line":"            _(\"Timeout waiting for device %s to be created\") % vbd_path)"},{"line_number":2186,"context_line":""},{"line_number":2187,"context_line":"    # wait for dev under /sys/devices/vbd-*/block to be ready"},{"line_number":2188,"context_line":"    block_path \u003d vbd_path + \u0027/block\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a629dbe_8b4dcf74","line":2185,"in_reply_to":"1aa78d24_6efb8f48","updated":"2016-11-08 08:15:38.000000000","message":"yes, this is ugly, I\u0027ve changed to use vbd instead of %s, and don\u0027t expose vdi_uuid as this is only meaning within XenServer Hypervisor","commit_id":"6bb662968a30241aac76c546b734532e30254699"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"71b65f19f3ef1886f3c21754dff85304da05926d","unresolved":false,"context_lines":[{"line_number":2191,"context_line":"        if dev_list and len(dev_list) \u003e 0:"},{"line_number":2192,"context_line":"            dev_tmp \u003d dev_list[0]"},{"line_number":2193,"context_line":"            break"},{"line_number":2194,"context_line":"        time.sleep(1)"},{"line_number":2195,"context_line":"    else:"},{"line_number":2196,"context_line":"        raise exception.StorageError(reason\u003d"},{"line_number":2197,"context_line":"            _(\"Timeout waiting for device %s to be created\") % block_path)"}],"source_content_type":"text/x-python","patch_set":27,"id":"1aa78d24_91853c5b","line":2194,"updated":"2016-07-07 21:27:10.000000000","message":"I\u0027ve seen some part of code using gevent\u0027s sleep, but perhaps this is monkey patched to work with gevent?","commit_id":"6bb662968a30241aac76c546b734532e30254699"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"c2949f2f8b3a5a3d8db20a4dd98eef35b4c4fa3e","unresolved":false,"context_lines":[{"line_number":2191,"context_line":"        if dev_list and len(dev_list) \u003e 0:"},{"line_number":2192,"context_line":"            dev_tmp \u003d dev_list[0]"},{"line_number":2193,"context_line":"            break"},{"line_number":2194,"context_line":"        time.sleep(1)"},{"line_number":2195,"context_line":"    else:"},{"line_number":2196,"context_line":"        raise exception.StorageError(reason\u003d"},{"line_number":2197,"context_line":"            _(\"Timeout waiting for device %s to be created\") % block_path)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a629dbe_0b4c5f41","line":2194,"in_reply_to":"1aa78d24_91853c5b","updated":"2016-11-08 08:15:38.000000000","message":"In nova repo, we\u0027ve seen greenthread.sleep/eventlet.sleep/time.sleep, but didn\u0027t see gevent.sleep(), do you mean some nova code using gevent.sleep() now?","commit_id":"6bb662968a30241aac76c546b734532e30254699"},{"author":{"_account_id":7789,"name":"John Wood","email":"john.wood@rackspace.com","username":"woodster"},"change_message_id":"71b65f19f3ef1886f3c21754dff85304da05926d","unresolved":false,"context_lines":[{"line_number":2198,"context_line":""},{"line_number":2199,"context_line":"    # wait for device node to be created"},{"line_number":2200,"context_line":"    dev_path \u003d utils.make_dev_path(dev_tmp)"},{"line_number":2201,"context_line":"    LOG.debug(\u0027Wait for device %s to be created\u0027, dev_path)"},{"line_number":2202,"context_line":"    for i in range(i, max_seconds):"},{"line_number":2203,"context_line":"        if os.path.exists(dev_path):"},{"line_number":2204,"context_line":"            return dev_path"}],"source_content_type":"text/x-python","patch_set":27,"id":"1aa78d24_d1f6a4f8","line":2201,"updated":"2016-07-07 21:27:10.000000000","message":"It might be good to have such a log statement before the other two wait loops above?","commit_id":"6bb662968a30241aac76c546b734532e30254699"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"17e66da1ee5ccb976852dd3d36ee4b7a4389798c","unresolved":false,"context_lines":[{"line_number":2198,"context_line":""},{"line_number":2199,"context_line":"    # wait for device node to be created"},{"line_number":2200,"context_line":"    dev_path \u003d utils.make_dev_path(dev_tmp)"},{"line_number":2201,"context_line":"    LOG.debug(\u0027Wait for device %s to be created\u0027, dev_path)"},{"line_number":2202,"context_line":"    for i in range(i, max_seconds):"},{"line_number":2203,"context_line":"        if os.path.exists(dev_path):"},{"line_number":2204,"context_line":"            return dev_path"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a629dbe_0160c5cd","line":2201,"in_reply_to":"1aa78d24_d1f6a4f8","updated":"2016-11-08 08:02:49.000000000","message":"Done","commit_id":"6bb662968a30241aac76c546b734532e30254699"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"087922597ce9b340020e456c1a3ab18e0ce1df78","unresolved":false,"context_lines":[{"line_number":2099,"context_line":""},{"line_number":2100,"context_line":"def _remap_vbd_dev(dev):"},{"line_number":2101,"context_line":"    \"\"\"Return the appropriate location for a plugged-in VBD device"},{"line_number":2102,"context_line":""},{"line_number":2103,"context_line":"    Ubuntu Maverick moved xvd? -\u003e sd?. This is considered a bug and will be"},{"line_number":2104,"context_line":"    fixed in future versions:"},{"line_number":2105,"context_line":"        https://bugs.launchpad.net/ubuntu/+source/linux/+bug/684875"}],"source_content_type":"text/x-python","patch_set":28,"id":"9a629dbe_c749738d","side":"PARENT","line":2102,"updated":"2016-11-08 11:23:00.000000000","message":"These should not have been removed","commit_id":"0dc1bc3eb9391958fa2532e1b93b6a4705d222fe"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"3646c3b823f63928a713e8929cc0bc7e411b263e","unresolved":false,"context_lines":[{"line_number":2099,"context_line":""},{"line_number":2100,"context_line":"def _remap_vbd_dev(dev):"},{"line_number":2101,"context_line":"    \"\"\"Return the appropriate location for a plugged-in VBD device"},{"line_number":2102,"context_line":""},{"line_number":2103,"context_line":"    Ubuntu Maverick moved xvd? -\u003e sd?. This is considered a bug and will be"},{"line_number":2104,"context_line":"    fixed in future versions:"},{"line_number":2105,"context_line":"        https://bugs.launchpad.net/ubuntu/+source/linux/+bug/684875"}],"source_content_type":"text/x-python","patch_set":28,"id":"9a629dbe_b02f2af5","side":"PARENT","line":2102,"in_reply_to":"9a629dbe_c749738d","updated":"2016-11-09 05:23:20.000000000","message":"Will remove this","commit_id":"0dc1bc3eb9391958fa2532e1b93b6a4705d222fe"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"087922597ce9b340020e456c1a3ab18e0ce1df78","unresolved":false,"context_lines":[{"line_number":2133,"context_line":""},{"line_number":2134,"context_line":""},{"line_number":2135,"context_line":"def _remap_vbd_dev(dev):"},{"line_number":2136,"context_line":"    \"\"\"Return the appropriate location for a plugged-in VBD device"},{"line_number":2137,"context_line":"    Ubuntu Maverick moved xvd? -\u003e sd?. This is considered a bug and will be"},{"line_number":2138,"context_line":"    fixed in future versions:"},{"line_number":2139,"context_line":"        https://bugs.launchpad.net/ubuntu/+source/linux/+bug/684875"},{"line_number":2140,"context_line":"    For now, we work around it by just doing a string replace."},{"line_number":2141,"context_line":"    \"\"\""},{"line_number":2142,"context_line":"    # NOTE(sirp): This hack can go away when we pull support for Maverick"},{"line_number":2143,"context_line":"    should_remap \u003d CONF.xenserver.remap_vbd_dev"},{"line_number":2144,"context_line":"    if not should_remap:"},{"line_number":2145,"context_line":"        return dev"},{"line_number":2146,"context_line":""},{"line_number":2147,"context_line":"    old_prefix \u003d \u0027xvd\u0027"},{"line_number":2148,"context_line":"    new_prefix \u003d CONF.xenserver.remap_vbd_dev_prefix"},{"line_number":2149,"context_line":"    remapped_dev \u003d dev.replace(old_prefix, new_prefix)"},{"line_number":2150,"context_line":""},{"line_number":2151,"context_line":"    return remapped_dev"},{"line_number":2152,"context_line":""},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"def _wait_for_device_independent_compute(session, vbd_ref, max_seconds):"}],"source_content_type":"text/x-python","patch_set":28,"id":"9a629dbe_e72597c2","line":2151,"range":{"start_line":2136,"start_character":0,"end_line":2151,"end_character":23},"updated":"2016-11-08 11:23:00.000000000","message":"Is this code still valid. Maverick is ancient and unsupported. If you\u0027re calling it then the docstring should be updated, IMO","commit_id":"96e481cd14b1f42d98cfdb788e0e0566afe24164"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"3646c3b823f63928a713e8929cc0bc7e411b263e","unresolved":false,"context_lines":[{"line_number":2133,"context_line":""},{"line_number":2134,"context_line":""},{"line_number":2135,"context_line":"def _remap_vbd_dev(dev):"},{"line_number":2136,"context_line":"    \"\"\"Return the appropriate location for a plugged-in VBD device"},{"line_number":2137,"context_line":"    Ubuntu Maverick moved xvd? -\u003e sd?. This is considered a bug and will be"},{"line_number":2138,"context_line":"    fixed in future versions:"},{"line_number":2139,"context_line":"        https://bugs.launchpad.net/ubuntu/+source/linux/+bug/684875"},{"line_number":2140,"context_line":"    For now, we work around it by just doing a string replace."},{"line_number":2141,"context_line":"    \"\"\""},{"line_number":2142,"context_line":"    # NOTE(sirp): This hack can go away when we pull support for Maverick"},{"line_number":2143,"context_line":"    should_remap \u003d CONF.xenserver.remap_vbd_dev"},{"line_number":2144,"context_line":"    if not should_remap:"},{"line_number":2145,"context_line":"        return dev"},{"line_number":2146,"context_line":""},{"line_number":2147,"context_line":"    old_prefix \u003d \u0027xvd\u0027"},{"line_number":2148,"context_line":"    new_prefix \u003d CONF.xenserver.remap_vbd_dev_prefix"},{"line_number":2149,"context_line":"    remapped_dev \u003d dev.replace(old_prefix, new_prefix)"},{"line_number":2150,"context_line":""},{"line_number":2151,"context_line":"    return remapped_dev"},{"line_number":2152,"context_line":""},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"def _wait_for_device_independent_compute(session, vbd_ref, max_seconds):"}],"source_content_type":"text/x-python","patch_set":28,"id":"9a629dbe_70ef52b0","line":2151,"range":{"start_line":2136,"start_character":0,"end_line":2151,"end_character":23},"in_reply_to":"9a629dbe_e72597c2","updated":"2016-11-09 05:23:20.000000000","message":"I will remove this","commit_id":"96e481cd14b1f42d98cfdb788e0e0566afe24164"}],"releasenotes/notes/bug-1318544-0a4a04985cc3a091.yaml":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"087922597ce9b340020e456c1a3ab18e0ce1df78","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"upgrade:"},{"line_number":3,"context_line":"  - Remove two config variables \u0027remap_vbd_dev\u0027 and"},{"line_number":4,"context_line":"    \u0027remap_vbd_dev_prefix\u0027 in nova/conf/xenserver.py."},{"line_number":5,"context_line":"    The new implementation do not rely on XenAPI call and"},{"line_number":6,"context_line":"    the two config variables are not used any more."}],"source_content_type":"text/x-yaml","patch_set":28,"id":"9a629dbe_472d63a6","line":6,"range":{"start_line":3,"start_character":0,"end_line":6,"end_character":51},"updated":"2016-11-08 11:23:00.000000000","message":"These aren\u0027t removed?","commit_id":"96e481cd14b1f42d98cfdb788e0e0566afe24164"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"3646c3b823f63928a713e8929cc0bc7e411b263e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"upgrade:"},{"line_number":3,"context_line":"  - Remove two config variables \u0027remap_vbd_dev\u0027 and"},{"line_number":4,"context_line":"    \u0027remap_vbd_dev_prefix\u0027 in nova/conf/xenserver.py."},{"line_number":5,"context_line":"    The new implementation do not rely on XenAPI call and"},{"line_number":6,"context_line":"    the two config variables are not used any more."}],"source_content_type":"text/x-yaml","patch_set":28,"id":"9a629dbe_d0ff3e65","line":6,"range":{"start_line":3,"start_character":0,"end_line":6,"end_character":51},"in_reply_to":"9a629dbe_472d63a6","updated":"2016-11-09 05:23:20.000000000","message":"These will be removed, I will change ths source code","commit_id":"96e481cd14b1f42d98cfdb788e0e0566afe24164"}]}
