)]}'
{"swift/obj/diskfile.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4962a048d195032330b52ab7a84e635dedc2b3bd","unresolved":false,"context_lines":[{"line_number":61,"context_line":"from swift import gettext_ as _"},{"line_number":62,"context_line":"from swift.common.constraints import check_drive"},{"line_number":63,"context_line":"from swift.common.request_helpers import is_sys_meta"},{"line_number":64,"context_line":"from swift.common.utils import mkdirs, Timestamp, \\"},{"line_number":65,"context_line":"    storage_directory, hash_path, renamer, fallocate, fsync, fdatasync, \\"},{"line_number":66,"context_line":"    fsync_dir, drop_buffer_cache, lock_path, write_pickle, \\"},{"line_number":67,"context_line":"    config_true_value, listdir, split_path, remove_file, \\"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_d5b52333","line":64,"range":{"start_line":64,"start_character":31,"end_line":64,"end_character":37},"updated":"2019-02-16 06:23:12.000000000","message":"Right, this one\u0027s ours...","commit_id":"4071960dbb72f026b04b65e6e357292d0818e646"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4962a048d195032330b52ab7a84e635dedc2b3bd","unresolved":false,"context_lines":[{"line_number":64,"context_line":"from swift.common.utils import mkdirs, Timestamp, \\"},{"line_number":65,"context_line":"    storage_directory, hash_path, renamer, fallocate, fsync, fdatasync, \\"},{"line_number":66,"context_line":"    fsync_dir, drop_buffer_cache, lock_path, write_pickle, \\"},{"line_number":67,"context_line":"    config_true_value, listdir, split_path, remove_file, \\"},{"line_number":68,"context_line":"    get_md5_socket, F_SETPIPE_SZ, decode_timestamps, encode_timestamps, \\"},{"line_number":69,"context_line":"    MD5_OF_EMPTY_STRING, link_fd_to_path, \\"},{"line_number":70,"context_line":"    O_TMPFILE, makedirs_count, replace_partition_in_path, remove_directory"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_35ab4fd6","line":67,"range":{"start_line":67,"start_character":44,"end_line":67,"end_character":55},"updated":"2019-02-16 06:23:12.000000000","message":"...and so\u0027s this","commit_id":"4071960dbb72f026b04b65e6e357292d0818e646"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4962a048d195032330b52ab7a84e635dedc2b3bd","unresolved":false,"context_lines":[{"line_number":1549,"context_line":"        \"\"\""},{"line_number":1550,"context_line":"        :param path: full path to directory"},{"line_number":1551,"context_line":"        \"\"\""},{"line_number":1552,"context_line":"        return os.remove(path)"},{"line_number":1553,"context_line":""},{"line_number":1554,"context_line":"    def isdir(self, path):"},{"line_number":1555,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_959c7bc0","line":1552,"updated":"2019-02-16 06:23:12.000000000","message":"So... I\u0027m not real clear on when we\u0027ll want remove vs rmdir... seems like they both take a dir?","commit_id":"4071960dbb72f026b04b65e6e357292d0818e646"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"e3d33c3b5b53330ef82cee3bd35a1d51e47e6fe7","unresolved":false,"context_lines":[{"line_number":1549,"context_line":"        \"\"\""},{"line_number":1550,"context_line":"        :param path: full path to directory"},{"line_number":1551,"context_line":"        \"\"\""},{"line_number":1552,"context_line":"        return os.remove(path)"},{"line_number":1553,"context_line":""},{"line_number":1554,"context_line":"    def isdir(self, path):"},{"line_number":1555,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_5fb625fb","line":1552,"in_reply_to":"9fdfeff1_959c7bc0","updated":"2019-02-18 06:46:33.000000000","message":"Ah, it might be reasonable question, we may not require both if we could do a refactor to the code in the future.","commit_id":"4071960dbb72f026b04b65e6e357292d0818e646"},{"author":{"_account_id":25251,"name":"Alexandre Lécuyer","email":"alexandre.lecuyer@corp.ovh.com","username":"alecuyer"},"change_message_id":"912096f7d10ac066bd88f6105460796c742fbee4","unresolved":false,"context_lines":[{"line_number":1549,"context_line":"        \"\"\""},{"line_number":1550,"context_line":"        :param path: full path to directory"},{"line_number":1551,"context_line":"        \"\"\""},{"line_number":1552,"context_line":"        return os.remove(path)"},{"line_number":1553,"context_line":""},{"line_number":1554,"context_line":"    def isdir(self, path):"},{"line_number":1555,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_3439dfd7","line":1552,"in_reply_to":"9fdfeff1_959c7bc0","updated":"2019-02-19 17:27:52.000000000","message":"As I remember it, I grepped for all os.* calls and made a function for each. It looks as if the only place where we use os.remove in swift/obj is in replicator.py, so I could change the call in that one place ? then this function is not needed  anymore.","commit_id":"4071960dbb72f026b04b65e6e357292d0818e646"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4962a048d195032330b52ab7a84e635dedc2b3bd","unresolved":false,"context_lines":[{"line_number":1555,"context_line":"        \"\"\""},{"line_number":1556,"context_line":"        :param path: full path to directory"},{"line_number":1557,"context_line":"        \"\"\""},{"line_number":1558,"context_line":"        return isdir(path)"},{"line_number":1559,"context_line":""},{"line_number":1560,"context_line":"    def isfile(self, path):"},{"line_number":1561,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_55a293fd","line":1558,"range":{"start_line":1558,"start_character":15,"end_line":1558,"end_character":20},"updated":"2019-02-16 06:23:12.000000000","message":"I might prefer to keep this as os.path.isdir, just to be clear on where it\u0027s coming from.","commit_id":"4071960dbb72f026b04b65e6e357292d0818e646"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"e3d33c3b5b53330ef82cee3bd35a1d51e47e6fe7","unresolved":false,"context_lines":[{"line_number":1555,"context_line":"        \"\"\""},{"line_number":1556,"context_line":"        :param path: full path to directory"},{"line_number":1557,"context_line":"        \"\"\""},{"line_number":1558,"context_line":"        return isdir(path)"},{"line_number":1559,"context_line":""},{"line_number":1560,"context_line":"    def isfile(self, path):"},{"line_number":1561,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_3fa8018a","line":1558,"range":{"start_line":1558,"start_character":15,"end_line":1558,"end_character":20},"in_reply_to":"9fdfeff1_55a293fd","updated":"2019-02-18 06:46:33.000000000","message":"I see, I\u0027ll patch it for you later.","commit_id":"4071960dbb72f026b04b65e6e357292d0818e646"}],"test/unit/obj/test_reconstructor.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4962a048d195032330b52ab7a84e635dedc2b3bd","unresolved":false,"context_lines":[{"line_number":1009,"context_line":"    def test_collect_parts_mkdirs_error(self):"},{"line_number":1010,"context_line":""},{"line_number":1011,"context_line":"        def blowup_mkdirs(path):"},{"line_number":1012,"context_line":"            raise OSError(\u0027Ow!\u0027)"},{"line_number":1013,"context_line":""},{"line_number":1014,"context_line":"        self.reconstructor._reset_stats()"},{"line_number":1015,"context_line":"        with mock.patch.object(diskfile, \u0027mkdirs\u0027, blowup_mkdirs):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_557b7379","line":1012,"range":{"start_line":1012,"start_character":18,"end_line":1012,"end_character":25},"updated":"2019-02-16 06:23:12.000000000","message":"So the expectation is that alternate diskfile implementations should also be raising OSErrors? Hmm... I wonder if we should be catching this at the DiskFileManager layer and raising a custom exception...","commit_id":"4071960dbb72f026b04b65e6e357292d0818e646"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"e3d33c3b5b53330ef82cee3bd35a1d51e47e6fe7","unresolved":false,"context_lines":[{"line_number":1009,"context_line":"    def test_collect_parts_mkdirs_error(self):"},{"line_number":1010,"context_line":""},{"line_number":1011,"context_line":"        def blowup_mkdirs(path):"},{"line_number":1012,"context_line":"            raise OSError(\u0027Ow!\u0027)"},{"line_number":1013,"context_line":""},{"line_number":1014,"context_line":"        self.reconstructor._reset_stats()"},{"line_number":1015,"context_line":"        with mock.patch.object(diskfile, \u0027mkdirs\u0027, blowup_mkdirs):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_3f96c13f","line":1012,"range":{"start_line":1012,"start_character":18,"end_line":1012,"end_character":25},"in_reply_to":"9fdfeff1_557b7379","updated":"2019-02-18 06:46:33.000000000","message":"In my understanding, it\u0027s not the constraint that the diskfile should raise OSError. I know it\u0027s not straightforward but this patching just change the behaviors of `swift.common.utils.mkdirs`. That is imported in the diskfile module without full-path usage.","commit_id":"4071960dbb72f026b04b65e6e357292d0818e646"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4962a048d195032330b52ab7a84e635dedc2b3bd","unresolved":false,"context_lines":[{"line_number":3140,"context_line":"        utils.mkdirs(os.path.dirname(datadir_path))"},{"line_number":3141,"context_line":"        with mock.patch(\u0027swift.obj.reconstructor.whataremyips\u0027,"},{"line_number":3142,"context_line":"                        return_value\u003d[self.ip]), \\"},{"line_number":3143,"context_line":"                mock.patch(\u0027swift.obj.diskfile.mkdirs\u0027,"},{"line_number":3144,"context_line":"                           side_effect\u003dOSError(\u0027kaboom!\u0027)):"},{"line_number":3145,"context_line":"            self.assertEqual([], list(self.reconstructor.collect_parts()))"},{"line_number":3146,"context_line":"        error_lines \u003d self.logger.get_lines_for_level(\u0027error\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_b5889f70","line":3143,"updated":"2019-02-16 06:23:12.000000000","message":"I wonder if we could change this to patch the *specific* diskfile, so we\u0027d get coverage for an alternate diskfile \"for free\"...","commit_id":"4071960dbb72f026b04b65e6e357292d0818e646"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"e3d33c3b5b53330ef82cee3bd35a1d51e47e6fe7","unresolved":false,"context_lines":[{"line_number":3140,"context_line":"        utils.mkdirs(os.path.dirname(datadir_path))"},{"line_number":3141,"context_line":"        with mock.patch(\u0027swift.obj.reconstructor.whataremyips\u0027,"},{"line_number":3142,"context_line":"                        return_value\u003d[self.ip]), \\"},{"line_number":3143,"context_line":"                mock.patch(\u0027swift.obj.diskfile.mkdirs\u0027,"},{"line_number":3144,"context_line":"                           side_effect\u003dOSError(\u0027kaboom!\u0027)):"},{"line_number":3145,"context_line":"            self.assertEqual([], list(self.reconstructor.collect_parts()))"},{"line_number":3146,"context_line":"        error_lines \u003d self.logger.get_lines_for_level(\u0027error\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_dfa455a5","line":3143,"in_reply_to":"9fdfeff1_b5889f70","updated":"2019-02-18 06:46:33.000000000","message":"Sounds good idea.","commit_id":"4071960dbb72f026b04b65e6e357292d0818e646"}]}
