)]}'
{"cinder/tests/unit/volume/drivers/test_rbd.py":[{"author":{"_account_id":13157,"name":"Zhao Chao","email":"zhaochao1984@gmail.com","username":"zhaochao"},"change_message_id":"72d8ade95c9612e651a09307ff57ea01629ec95e","unresolved":false,"context_lines":[{"line_number":566,"context_line":"        image \u003d self.mock_proxy.return_value.__enter__.return_value"},{"line_number":567,"context_line":"        image.size.side_effect \u003d [2 * units.Gi, 4 * units.Gi]"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"        mock_get_image_status.return_value \u003d {\u0027watchers\u0027: []}"},{"line_number":570,"context_line":"        res \u003d self.driver.get_manageable_volumes(cinder_vols, None,"},{"line_number":571,"context_line":"                                                 1000, 0,"},{"line_number":572,"context_line":"                                                 [\u0027size\u0027], [\u0027asc\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_a2ffcaa8","line":569,"updated":"2018-01-03 06:36:47.000000000","message":"There are 3 different cases of rbd images in get_manageable_volumes (already managed, unmanaged but has watchers, safe to be manageed), so for unittesting, all these cases should be covered, but only 2 of them are covered here.","commit_id":"f8dc4d11c954f5aa372d01329089e06fddb9d429"},{"author":{"_account_id":23081,"name":"Jeremy Zhang","email":"zhangjun_inspur@163.com","username":"jeremy.zhang"},"change_message_id":"1ff574f36979f2d38926178727331c221376762e","unresolved":false,"context_lines":[{"line_number":566,"context_line":"        image \u003d self.mock_proxy.return_value.__enter__.return_value"},{"line_number":567,"context_line":"        image.size.side_effect \u003d [2 * units.Gi, 4 * units.Gi]"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"        mock_get_image_status.return_value \u003d {\u0027watchers\u0027: []}"},{"line_number":570,"context_line":"        res \u003d self.driver.get_manageable_volumes(cinder_vols, None,"},{"line_number":571,"context_line":"                                                 1000, 0,"},{"line_number":572,"context_line":"                                                 [\u0027size\u0027], [\u0027asc\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_36c77b15","line":569,"in_reply_to":"9f91af0f_a2ffcaa8","updated":"2018-01-03 08:11:28.000000000","message":"Done, thanks","commit_id":"f8dc4d11c954f5aa372d01329089e06fddb9d429"}],"cinder/volume/drivers/rbd.py":[{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"15cafb456d5080bcd8540b6a81ba260a5f7ca2ab","unresolved":false,"context_lines":[{"line_number":1389,"context_line":"                raise exception.VolumeBackendAPIException("},{"line_number":1390,"context_line":"                    data\u003dexception_message)"},{"line_number":1391,"context_line":""},{"line_number":1392,"context_line":"    def _get_image_status(self, image_name):"},{"line_number":1393,"context_line":"        args \u003d [\u0027rbd\u0027, \u0027status\u0027,"},{"line_number":1394,"context_line":"                \u0027--pool\u0027, self.configuration.rbd_pool,"},{"line_number":1395,"context_line":"                \u0027--format\u003djson\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_7dae4e2f","line":1392,"updated":"2018-01-02 16:28:25.000000000","message":"Is it really necessary to call out to the shell command to get this info, instead of using librbd?","commit_id":"f8dc4d11c954f5aa372d01329089e06fddb9d429"},{"author":{"_account_id":13157,"name":"Zhao Chao","email":"zhaochao1984@gmail.com","username":"zhaochao"},"change_message_id":"72d8ade95c9612e651a09307ff57ea01629ec95e","unresolved":false,"context_lines":[{"line_number":1389,"context_line":"                raise exception.VolumeBackendAPIException("},{"line_number":1390,"context_line":"                    data\u003dexception_message)"},{"line_number":1391,"context_line":""},{"line_number":1392,"context_line":"    def _get_image_status(self, image_name):"},{"line_number":1393,"context_line":"        args \u003d [\u0027rbd\u0027, \u0027status\u0027,"},{"line_number":1394,"context_line":"                \u0027--pool\u0027, self.configuration.rbd_pool,"},{"line_number":1395,"context_line":"                \u0027--format\u003djson\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_e2c2b285","line":1392,"in_reply_to":"9f91af0f_017eb86a","updated":"2018-01-03 06:36:47.000000000","message":"\"rbd status\" only list watchers of an rbd image, this feature has been added to librbd and python-rbd[1]. However \"rbd status\" was introduced in Feb 2015[2], and librbd and python-rbd added these changes in Nov 2017. \n\nWithout support from librbd and python-rbd, we have to first get the head object of the rbd image, then call \"rados listwatchers\" command line to get the list of watchers (as the watcher listing interface is not exposed in python-rados).\n\nSo maybe it\u0027s simpler to just use \"rbd status\" here.\n\n[1]: https://github.com/ceph/ceph/pull/19188/commits\n[2]: https://github.com/ceph/ceph/commit/0d6963b3bc8788e4119fd51294fe5a54bab99112","commit_id":"f8dc4d11c954f5aa372d01329089e06fddb9d429"},{"author":{"_account_id":23081,"name":"Jeremy Zhang","email":"zhangjun_inspur@163.com","username":"jeremy.zhang"},"change_message_id":"553358bd8a0c04d82ef435d8cedbdbadad30e9b1","unresolved":false,"context_lines":[{"line_number":1389,"context_line":"                raise exception.VolumeBackendAPIException("},{"line_number":1390,"context_line":"                    data\u003dexception_message)"},{"line_number":1391,"context_line":""},{"line_number":1392,"context_line":"    def _get_image_status(self, image_name):"},{"line_number":1393,"context_line":"        args \u003d [\u0027rbd\u0027, \u0027status\u0027,"},{"line_number":1394,"context_line":"                \u0027--pool\u0027, self.configuration.rbd_pool,"},{"line_number":1395,"context_line":"                \u0027--format\u003djson\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_017eb86a","line":1392,"in_reply_to":"9f91af0f_7dae4e2f","updated":"2018-01-03 01:24:33.000000000","message":"@Eric, thanks for your review.\n\nIt seems that the `librbd` still not provides the interface or function to get the rbd\u0027s status. See http://docs.ceph.org.cn/rbd/librbdpy. So here just use the rbd shell command, looking forward your opinions.","commit_id":"f8dc4d11c954f5aa372d01329089e06fddb9d429"},{"author":{"_account_id":23081,"name":"Jeremy Zhang","email":"zhangjun_inspur@163.com","username":"jeremy.zhang"},"change_message_id":"1ff574f36979f2d38926178727331c221376762e","unresolved":false,"context_lines":[{"line_number":1389,"context_line":"                raise exception.VolumeBackendAPIException("},{"line_number":1390,"context_line":"                    data\u003dexception_message)"},{"line_number":1391,"context_line":""},{"line_number":1392,"context_line":"    def _get_image_status(self, image_name):"},{"line_number":1393,"context_line":"        args \u003d [\u0027rbd\u0027, \u0027status\u0027,"},{"line_number":1394,"context_line":"                \u0027--pool\u0027, self.configuration.rbd_pool,"},{"line_number":1395,"context_line":"                \u0027--format\u003djson\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_96e1a79d","line":1392,"in_reply_to":"9f91af0f_e2c2b285","updated":"2018-01-03 08:11:28.000000000","message":"@Zhao Chao, thanks a lot for your explanation, :)","commit_id":"f8dc4d11c954f5aa372d01329089e06fddb9d429"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"a9eea60bbcf3948a9211f939e75802ae4fdecb5b","unresolved":false,"context_lines":[{"line_number":1419,"context_line":"                            image_info[\u0027cinder_id\u0027] \u003d image_id"},{"line_number":1420,"context_line":"                            image_info[\u0027safe_to_manage\u0027] \u003d False"},{"line_number":1421,"context_line":"                            image_info[\u0027reason_not_safe\u0027] \u003d \u0027already managed\u0027"},{"line_number":1422,"context_line":"                        elif len(self._get_image_status("},{"line_number":1423,"context_line":"                                image_name)[\u0027watchers\u0027]) \u003e 0:"},{"line_number":1424,"context_line":"                            # If the num of watchers of image is \u003e\u003d 1, then the"},{"line_number":1425,"context_line":"                            # image is considered to be used by client(s)."},{"line_number":1426,"context_line":"                            image_info[\u0027safe_to_manage\u0027] \u003d False"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f96bb07_3ff13896","line":1423,"range":{"start_line":1422,"start_character":29,"end_line":1423,"end_character":60},"updated":"2018-01-16 10:49:27.000000000","message":"nit: it could be simplified to:\nelif len(self._get_image_status(\n                                image_name)[\u0027watchers\u0027]):","commit_id":"164246094e90af6f63f63c321514b07a655941a9"}]}
