)]}'
{"cinder/backup/chunkeddriver.py":[{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"1eac8f228605f4fa56aae3a8c1d547fd7e363a6f","unresolved":false,"context_lines":[{"line_number":125,"context_line":"            # to fail out early and avoid attaching the disks, we\u0027ll just"},{"line_number":126,"context_line":"            # enforce the chunk size to be a multiple of 4096."},{"line_number":127,"context_line":"            err \u003d _(\"Invalid chunk size. It must be a multiple of 4096.\")"},{"line_number":128,"context_line":"            raise exception.InvalidBackup(reason\u003derr)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _get_object_writer(self, container, object_name, extra_metadata\u003dNone):"},{"line_number":131,"context_line":"        \"\"\"Return writer proxy-wrapped to execute methods in native thread.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_751718a5","line":128,"updated":"2018-02-07 15:39:22.000000000","message":"Please, use InvalidConfigurationValue here","commit_id":"b56198fcfd7b84eb3e3969f40205790815bc383f"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"358b8654f60d6741dcb098851e943a996b07e3ee","unresolved":false,"context_lines":[{"line_number":125,"context_line":"            # to fail out early and avoid attaching the disks, we\u0027ll just"},{"line_number":126,"context_line":"            # enforce the chunk size to be a multiple of 4096."},{"line_number":127,"context_line":"            err \u003d _(\"Invalid chunk size. It must be a multiple of 4096.\")"},{"line_number":128,"context_line":"            raise exception.InvalidBackup(reason\u003derr)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _get_object_writer(self, container, object_name, extra_metadata\u003dNone):"},{"line_number":131,"context_line":"        \"\"\"Return writer proxy-wrapped to execute methods in native thread.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_66f68dfc","line":128,"in_reply_to":"3fa0c359_751718a5","updated":"2018-02-07 18:20:38.000000000","message":"Done","commit_id":"b56198fcfd7b84eb3e3969f40205790815bc383f"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"1eac8f228605f4fa56aae3a8c1d547fd7e363a6f","unresolved":false,"context_lines":[{"line_number":510,"context_line":"            # size of the disk. Attempting to read passed this boundary will"},{"line_number":511,"context_line":"            # lead to an IOError exception. At the same time, we cannot"},{"line_number":512,"context_line":"            # seek to the end of file."},{"line_number":513,"context_line":"            win32_disk_size \u003d self._get_win32_phys_disk_size(volume_file.name)"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"        (object_meta, object_sha256, extra_metadata, container,"},{"line_number":516,"context_line":"         volume_size_bytes) \u003d self._prepare_backup(backup)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_158334ce","line":513,"updated":"2018-02-07 15:39:22.000000000","message":"Please, move this to line #555 to remove one if statement","commit_id":"b56198fcfd7b84eb3e3969f40205790815bc383f"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"358b8654f60d6741dcb098851e943a996b07e3ee","unresolved":false,"context_lines":[{"line_number":510,"context_line":"            # size of the disk. Attempting to read passed this boundary will"},{"line_number":511,"context_line":"            # lead to an IOError exception. At the same time, we cannot"},{"line_number":512,"context_line":"            # seek to the end of file."},{"line_number":513,"context_line":"            win32_disk_size \u003d self._get_win32_phys_disk_size(volume_file.name)"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"        (object_meta, object_sha256, extra_metadata, container,"},{"line_number":516,"context_line":"         volume_size_bytes) \u003d self._prepare_backup(backup)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_e68cdd80","line":513,"in_reply_to":"3fa0c359_158334ce","updated":"2018-02-07 18:20:38.000000000","message":"That would mean moving it inside the \"while\" loop, basically fetching the disk size for every chunk that we read. I\u0027d rather avoid it as it\u0027s a time consuming operation.","commit_id":"b56198fcfd7b84eb3e3969f40205790815bc383f"}],"cinder/tests/unit/backup/test_backup.py":[{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"1eac8f228605f4fa56aae3a8c1d547fd7e363a6f","unresolved":false,"context_lines":[{"line_number":1039,"context_line":"        with mock.patch(\u0027os.name\u0027, os_name):"},{"line_number":1040,"context_line":"            self.backup_mgr.restore_backup(self.ctxt, backup, vol_id)"},{"line_number":1041,"context_line":""},{"line_number":1042,"context_line":"        exp_open_mode \u003d \u0027rb+\u0027 if os_name \u003d\u003d \u0027nt\u0027 else \u0027wb\u0027"},{"line_number":1043,"context_line":"        mock_open.assert_called_once_with(\u0027/dev/null\u0027, exp_open_mode)"},{"line_number":1044,"context_line":"        mock_temporary_chown.assert_called_once_with(\u0027/dev/null\u0027)"},{"line_number":1045,"context_line":"        mock_get_conn.assert_called_once_with()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_954f44bc","line":1042,"updated":"2018-02-07 15:39:22.000000000","message":"Please, move open_mode  to ddt too. We don\u0027t need \u0027if\u0027 statement here","commit_id":"b56198fcfd7b84eb3e3969f40205790815bc383f"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"358b8654f60d6741dcb098851e943a996b07e3ee","unresolved":false,"context_lines":[{"line_number":1039,"context_line":"        with mock.patch(\u0027os.name\u0027, os_name):"},{"line_number":1040,"context_line":"            self.backup_mgr.restore_backup(self.ctxt, backup, vol_id)"},{"line_number":1041,"context_line":""},{"line_number":1042,"context_line":"        exp_open_mode \u003d \u0027rb+\u0027 if os_name \u003d\u003d \u0027nt\u0027 else \u0027wb\u0027"},{"line_number":1043,"context_line":"        mock_open.assert_called_once_with(\u0027/dev/null\u0027, exp_open_mode)"},{"line_number":1044,"context_line":"        mock_temporary_chown.assert_called_once_with(\u0027/dev/null\u0027)"},{"line_number":1045,"context_line":"        mock_get_conn.assert_called_once_with()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_86bcf9dc","line":1042,"in_reply_to":"3fa0c359_954f44bc","updated":"2018-02-07 18:20:38.000000000","message":"Done","commit_id":"b56198fcfd7b84eb3e3969f40205790815bc383f"}],"cinder/utils.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"de3c720ccc466eab388814df42092efc7dbba917","unresolved":false,"context_lines":[{"line_number":420,"context_line":"    if os.name \u003d\u003d \u0027nt\u0027:"},{"line_number":421,"context_line":"        LOG.debug(\"Skipping chown for %s as this operation is \""},{"line_number":422,"context_line":"                  \"not available on Windows.\", path)"},{"line_number":423,"context_line":"        yield"},{"line_number":424,"context_line":"        return"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    if owner_uid is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_430c31a4","line":423,"updated":"2018-01-17 21:31:43.000000000","message":"Can you explain why we need yield before returning?","commit_id":"6a5415cf71870d3a02cca793f972ddc3b61db0db"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"cb79a2cb0b141627de4369b03f1484e95b792898","unresolved":false,"context_lines":[{"line_number":420,"context_line":"    if os.name \u003d\u003d \u0027nt\u0027:"},{"line_number":421,"context_line":"        LOG.debug(\"Skipping chown for %s as this operation is \""},{"line_number":422,"context_line":"                  \"not available on Windows.\", path)"},{"line_number":423,"context_line":"        yield"},{"line_number":424,"context_line":"        return"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    if owner_uid is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_69926359","line":423,"in_reply_to":"7f96bb07_430c31a4","updated":"2018-01-18 06:09:59.000000000","message":"When defining context managers using contextlib, the decorated method is expected to provide a generator returning a single element, in other words yielding exactly once before returning.\n\nTo provide some more insight, here\u0027s the contextlib implementation, the \u0027__enter__\u0027 and \u0027__exit__\u0027 methods simply fetching one element from the generator: https://github.com/python/cpython/blob/2.7/Lib/contextlib.py#L15-L26.","commit_id":"6a5415cf71870d3a02cca793f972ddc3b61db0db"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"8d8fb1cdab19bde8f4b673b693ed1b38213e42d0","unresolved":false,"context_lines":[{"line_number":420,"context_line":"    if os.name \u003d\u003d \u0027nt\u0027:"},{"line_number":421,"context_line":"        LOG.debug(\"Skipping chown for %s as this operation is \""},{"line_number":422,"context_line":"                  \"not available on Windows.\", path)"},{"line_number":423,"context_line":"        yield"},{"line_number":424,"context_line":"        return"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    if owner_uid is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_fcbb2c6f","line":423,"in_reply_to":"7f96bb07_69926359","updated":"2018-01-22 17:23:28.000000000","message":"But then the return is not needed in this case, right?","commit_id":"6a5415cf71870d3a02cca793f972ddc3b61db0db"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"22a704ee3f3b081bb8783d4ee19aecb262d98a85","unresolved":false,"context_lines":[{"line_number":420,"context_line":"    if os.name \u003d\u003d \u0027nt\u0027:"},{"line_number":421,"context_line":"        LOG.debug(\"Skipping chown for %s as this operation is \""},{"line_number":422,"context_line":"                  \"not available on Windows.\", path)"},{"line_number":423,"context_line":"        yield"},{"line_number":424,"context_line":"        return"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    if owner_uid is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_dc443077","line":423,"in_reply_to":"7f96bb07_fcbb2c6f","updated":"2018-01-22 17:30:07.000000000","message":"Even though it yields, it still needs to return. By returning here, we avoid going through the unsupported bits.","commit_id":"6a5415cf71870d3a02cca793f972ddc3b61db0db"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"b03d8a623bab39368e61faa79ab1cd98d331ae1d","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        LOG.debug(\"Skipping chown for %s as this operation is \""},{"line_number":437,"context_line":"                  \"not available on Windows.\", path)"},{"line_number":438,"context_line":"        yield"},{"line_number":439,"context_line":"        return"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"    if owner_uid is None:"},{"line_number":442,"context_line":"        owner_uid \u003d os.getuid()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_b63940a4","line":439,"range":{"start_line":439,"start_character":8,"end_line":439,"end_character":14},"updated":"2018-01-22 17:30:23.000000000","message":"I do think this should be removed, but it doesn\u0027t \"hurt\" anything either.  The yield should act as a return if this is infact a genertor no?","commit_id":"6a6867b8ab5f9adfded58279a4620b868c21ceba"}]}
