)]}'
{"kolla/image/build.py":[{"author":{"_account_id":7488,"name":"Jeffrey Zhang","email":"zhang.lei.fly@gmail.com","username":"Jeffrey4l"},"change_message_id":"05e53e849758c864ece1d3422627db0c6e77d91f","unresolved":false,"context_lines":[{"line_number":309,"context_line":"        elif source.get(\u0027type\u0027) \u003d\u003d \u0027git\u0027:"},{"line_number":310,"context_line":"            clone_dir \u003d \u0027{}-{}\u0027.format(dest_archive,"},{"line_number":311,"context_line":"                                       source[\u0027reference\u0027].replace(\u0027/\u0027, \u0027-\u0027))"},{"line_number":312,"context_line":"            if os.path.exists(clone_dir) and os.listdir(clone_dir):"},{"line_number":313,"context_line":"                self.logger.debug(\"Clone dir %s is not empty. Clean it up\","},{"line_number":314,"context_line":"                                  clone_dir)"},{"line_number":315,"context_line":"                shutil.rmtree(clone_dir)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_ade2c89e","line":312,"updated":"2017-07-27 03:15:34.000000000","message":"listdir is useless imo.","commit_id":"db5eba2e2dbe375ac498cd3a2c6d8087c47f6f30"},{"author":{"_account_id":23440,"name":"jiriprox","email":"jirix.x.prokes@intel.com","username":"jiriprox"},"change_message_id":"b0739f62fb70632f9e1b0c2d250029710951aa7c","unresolved":false,"context_lines":[{"line_number":309,"context_line":"        elif source.get(\u0027type\u0027) \u003d\u003d \u0027git\u0027:"},{"line_number":310,"context_line":"            clone_dir \u003d \u0027{}-{}\u0027.format(dest_archive,"},{"line_number":311,"context_line":"                                       source[\u0027reference\u0027].replace(\u0027/\u0027, \u0027-\u0027))"},{"line_number":312,"context_line":"            if os.path.exists(clone_dir) and os.listdir(clone_dir):"},{"line_number":313,"context_line":"                self.logger.debug(\"Clone dir %s is not empty. Clean it up\","},{"line_number":314,"context_line":"                                  clone_dir)"},{"line_number":315,"context_line":"                shutil.rmtree(clone_dir)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_a7d41c21","line":312,"in_reply_to":"ff346bd7_ade2c89e","updated":"2017-07-27 08:22:17.000000000","message":"If we accept that clone directory should not exist before cloning at all then you are right and listdir is useless.\nNevertheless sometimes you can have pre-created empty directory before cloning. So, should we clean it up whenever directory exist?","commit_id":"db5eba2e2dbe375ac498cd3a2c6d8087c47f6f30"},{"author":{"_account_id":19316,"name":"Eduardo Gonzalez","email":"dabarren@gmail.com","username":"egonzalez90"},"change_message_id":"b6ac40bbcbb18f589eeaafb537804ce8075e9310","unresolved":false,"context_lines":[{"line_number":310,"context_line":"            clone_dir \u003d \u0027{}-{}\u0027.format(dest_archive,"},{"line_number":311,"context_line":"                                       source[\u0027reference\u0027].replace(\u0027/\u0027, \u0027-\u0027))"},{"line_number":312,"context_line":"            if os.path.exists(clone_dir) and os.listdir(clone_dir):"},{"line_number":313,"context_line":"                self.logger.debug(\"Clone dir %s is not empty. Clean it up\","},{"line_number":314,"context_line":"                                  clone_dir)"},{"line_number":315,"context_line":"                shutil.rmtree(clone_dir)"},{"line_number":316,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_846916fa","line":313,"range":{"start_line":313,"start_character":62,"end_line":313,"end_character":73},"updated":"2017-07-27 08:11:34.000000000","message":"log message does not say what is really doing the code.\n\nLogs says the user to remove the dir, but line 315 actually removes the dir without user action","commit_id":"db5eba2e2dbe375ac498cd3a2c6d8087c47f6f30"},{"author":{"_account_id":23440,"name":"jiriprox","email":"jirix.x.prokes@intel.com","username":"jiriprox"},"change_message_id":"70198ee9bd32f4fb3b7e30374efad17bf5443c71","unresolved":false,"context_lines":[{"line_number":310,"context_line":"            clone_dir \u003d \u0027{}-{}\u0027.format(dest_archive,"},{"line_number":311,"context_line":"                                       source[\u0027reference\u0027].replace(\u0027/\u0027, \u0027-\u0027))"},{"line_number":312,"context_line":"            if os.path.exists(clone_dir) and os.listdir(clone_dir):"},{"line_number":313,"context_line":"                self.logger.debug(\"Clone dir %s is not empty. Clean it up\","},{"line_number":314,"context_line":"                                  clone_dir)"},{"line_number":315,"context_line":"                shutil.rmtree(clone_dir)"},{"line_number":316,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_6d7bb57a","line":313,"range":{"start_line":313,"start_character":62,"end_line":313,"end_character":73},"in_reply_to":"ff346bd7_846916fa","updated":"2017-07-27 09:11:16.000000000","message":"You are right. Is this better?\n\"Clone dir %s is not empty. Cleaning it.\"\nor for case we skip listdir.\n\"Clone dir %s exists. Removing it.\"\nWhat do you prefer?","commit_id":"db5eba2e2dbe375ac498cd3a2c6d8087c47f6f30"},{"author":{"_account_id":26159,"name":"xiexianbin","email":"xiexianbin@yovole.com","username":"xianbin"},"change_message_id":"073966caa41074035c77be59413ee5b529199391","unresolved":false,"context_lines":[{"line_number":325,"context_line":"                self.logger.error(\"Failed to get source from git\", image.name)"},{"line_number":326,"context_line":"                self.logger.error(\"Error: %s\", e)"},{"line_number":327,"context_line":"                # clean-up clone folder to retry"},{"line_number":328,"context_line":"                shutil.rmtree(clone_dir)"},{"line_number":329,"context_line":"                image.status \u003d STATUS_ERROR"},{"line_number":330,"context_line":"                return"},{"line_number":331,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ff346bd7_eb2766c9","line":328,"range":{"start_line":328,"start_character":16,"end_line":328,"end_character":40},"updated":"2017-07-28 08:58:00.000000000","message":"when raise exception, we already delete clone_dir, why it is exist? do you know why?","commit_id":"08c0d325ad808d88b63d1858da2a2b49e260271e"},{"author":{"_account_id":23440,"name":"jiriprox","email":"jirix.x.prokes@intel.com","username":"jiriprox"},"change_message_id":"0ba2e701ccbf15dac64fb1d89ba878ee0bda9c65","unresolved":false,"context_lines":[{"line_number":325,"context_line":"                self.logger.error(\"Failed to get source from git\", image.name)"},{"line_number":326,"context_line":"                self.logger.error(\"Error: %s\", e)"},{"line_number":327,"context_line":"                # clean-up clone folder to retry"},{"line_number":328,"context_line":"                shutil.rmtree(clone_dir)"},{"line_number":329,"context_line":"                image.status \u003d STATUS_ERROR"},{"line_number":330,"context_line":"                return"},{"line_number":331,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ff346bd7_66d60b2b","line":328,"range":{"start_line":328,"start_character":16,"end_line":328,"end_character":40},"in_reply_to":"ff346bd7_eb2766c9","updated":"2017-07-28 09:16:24.000000000","message":"It covers only case that cloning failed. In our case cloning is ok and during image building any temporary error like short network outage, http_proxy outage cause build failing and new attempt to build. In this case clone directory exists and is not empty.","commit_id":"08c0d325ad808d88b63d1858da2a2b49e260271e"}]}
