)]}'
{"trove/guestagent/strategies/restore/mysql_impl.py":[{"author":{"_account_id":10215,"name":"Peter Stachowski","email":"peter@tesora.com","username":"peterstac"},"change_message_id":"57d56a128611c1e566bf23ab51eb5d5ed3532b36","unresolved":false,"context_lines":[{"line_number":129,"context_line":"            self._writelines_one_per_line(init_file,"},{"line_number":130,"context_line":"                                          self.RESET_ROOT_MYSQL_COMMANDS)"},{"line_number":131,"context_line":"            # Do not attempt to delete the file as the \u0027trove\u0027 user."},{"line_number":132,"context_line":"            # The process writing into it may have assumed it\u0027s ownership."},{"line_number":133,"context_line":"            # Only owners can delete temporary"},{"line_number":134,"context_line":"            # files (restricted deletion)."},{"line_number":135,"context_line":"            err_log_file \u003d tempfile.NamedTemporaryFile("}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_1f3d0990","line":132,"updated":"2015-02-21 00:37:43.000000000","message":"typo - should be \u0027its\u0027","commit_id":"258ea18d485c9a522759f786fdd8357111515029"},{"author":{"_account_id":10215,"name":"Peter Stachowski","email":"peter@tesora.com","username":"peterstac"},"change_message_id":"57d56a128611c1e566bf23ab51eb5d5ed3532b36","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        return None"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    @classmethod"},{"line_number":156,"context_line":"    def _silent_cleanup_temp_file(self, fp):"},{"line_number":157,"context_line":"        \"\"\"Force-remove a given file as root."},{"line_number":158,"context_line":"        Do not raise an exception on failure."},{"line_number":159,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_bfc87d75","line":156,"updated":"2015-02-21 00:37:43.000000000","message":"how about _delete_temp_file?  I\u0027m not sure what the silent refers to and cleanup is pretty vague ...\n\nBe nice if this could move to a utility module, since it\u0027s pretty generic.","commit_id":"258ea18d485c9a522759f786fdd8357111515029"},{"author":{"_account_id":13355,"name":"Edmond Kotowski","email":"ekotowski@gmail.com","username":"ekotowski"},"change_message_id":"9fe3059f40933d0b8a61a0ba2353394fc8c9ff04","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        with tempfile.NamedTemporaryFile() as init_file:"},{"line_number":128,"context_line":"            utils.execute_with_timeout(\"sudo\", \"chmod\", \"a+r\", init_file.name)"},{"line_number":129,"context_line":"            self._writelines_one_per_line(init_file,"},{"line_number":130,"context_line":"                                          self.RESET_ROOT_MYSQL_COMMANDS)"},{"line_number":131,"context_line":"            # Do not attempt to delete the file as the \u0027trove\u0027 user."},{"line_number":132,"context_line":"            # The process writing into it may have assumed its ownership."},{"line_number":133,"context_line":"            # Only owners can delete temporary"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_961d5b69","line":130,"updated":"2015-02-21 18:37:53.000000000","message":"I would expect this change to break a unit test? If not, we should probably have test coverage around this functionality.","commit_id":"790d7624ed92630882259da9cf1576a6c61b2520"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"4bf0a9a39c336e85e4eff2b4ebd50638518baa29","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        with tempfile.NamedTemporaryFile() as init_file:"},{"line_number":128,"context_line":"            utils.execute_with_timeout(\"sudo\", \"chmod\", \"a+r\", init_file.name)"},{"line_number":129,"context_line":"            self._writelines_one_per_line(init_file,"},{"line_number":130,"context_line":"                                          self.RESET_ROOT_MYSQL_COMMANDS)"},{"line_number":131,"context_line":"            # Do not attempt to delete the file as the \u0027trove\u0027 user."},{"line_number":132,"context_line":"            # The process writing into it may have assumed its ownership."},{"line_number":133,"context_line":"            # Only owners can delete temporary"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_b6b6df3b","line":130,"in_reply_to":"ba7be1f8_961d5b69","updated":"2015-02-21 19:09:41.000000000","message":"It would break int-tests on Percona, but only after https://review.openstack.org/#/c/157973/ gets merged.","commit_id":"790d7624ed92630882259da9cf1576a6c61b2520"},{"author":{"_account_id":13355,"name":"Edmond Kotowski","email":"ekotowski@gmail.com","username":"ekotowski"},"change_message_id":"7c60e523f9f868b1b47ad51669124228eef58559","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        with tempfile.NamedTemporaryFile() as init_file:"},{"line_number":128,"context_line":"            utils.execute_with_timeout(\"sudo\", \"chmod\", \"a+r\", init_file.name)"},{"line_number":129,"context_line":"            self._writelines_one_per_line(init_file,"},{"line_number":130,"context_line":"                                          self.RESET_ROOT_MYSQL_COMMANDS)"},{"line_number":131,"context_line":"            # Do not attempt to delete the file as the \u0027trove\u0027 user."},{"line_number":132,"context_line":"            # The process writing into it may have assumed its ownership."},{"line_number":133,"context_line":"            # Only owners can delete temporary"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_96c47b41","line":130,"in_reply_to":"ba7be1f8_b6b6df3b","updated":"2015-02-21 20:14:17.000000000","message":"I would expect to have a unit test on the new method delete temp file that asserts you are calling execute_with_timeout with \"sudo rm -f\", because if someone changes this it would break the test which would be important because we would back to the bug you are fixing.","commit_id":"790d7624ed92630882259da9cf1576a6c61b2520"},{"author":{"_account_id":13355,"name":"Edmond Kotowski","email":"ekotowski@gmail.com","username":"ekotowski"},"change_message_id":"9fe3059f40933d0b8a61a0ba2353394fc8c9ff04","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            try:"},{"line_number":139,"context_line":"                self._start_mysqld_safe_with_init_file(init_file, err_log_file)"},{"line_number":140,"context_line":"            finally:"},{"line_number":141,"context_line":"                MySQLRestoreMixin._delete_temp_file(err_log_file)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def _writelines_one_per_line(self, fp, lines):"},{"line_number":144,"context_line":"        fp.write(os.linesep.join(lines))"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_7610e74e","line":141,"updated":"2015-02-21 18:37:53.000000000","message":"This method should be in charge of closing the file as it opened it in the first place.","commit_id":"790d7624ed92630882259da9cf1576a6c61b2520"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"4bf0a9a39c336e85e4eff2b4ebd50638518baa29","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            try:"},{"line_number":139,"context_line":"                self._start_mysqld_safe_with_init_file(init_file, err_log_file)"},{"line_number":140,"context_line":"            finally:"},{"line_number":141,"context_line":"                MySQLRestoreMixin._delete_temp_file(err_log_file)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def _writelines_one_per_line(self, fp, lines):"},{"line_number":144,"context_line":"        fp.write(os.linesep.join(lines))"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_36abcfd9","line":141,"in_reply_to":"ba7be1f8_7610e74e","updated":"2015-02-21 19:09:41.000000000","message":"Sure I can close it here.","commit_id":"790d7624ed92630882259da9cf1576a6c61b2520"},{"author":{"_account_id":13355,"name":"Edmond Kotowski","email":"ekotowski@gmail.com","username":"ekotowski"},"change_message_id":"9fe3059f40933d0b8a61a0ba2353394fc8c9ff04","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        return None"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    @classmethod"},{"line_number":156,"context_line":"    def _delete_temp_file(self, fp):"},{"line_number":157,"context_line":"        \"\"\"Force-remove a given file as root."},{"line_number":158,"context_line":"        Do not raise an exception on failure."},{"line_number":159,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_5613e35b","line":156,"updated":"2015-02-21 18:37:53.000000000","message":"Just inject the file name in here","commit_id":"790d7624ed92630882259da9cf1576a6c61b2520"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"4bf0a9a39c336e85e4eff2b4ebd50638518baa29","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        return None"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    @classmethod"},{"line_number":156,"context_line":"    def _delete_temp_file(self, fp):"},{"line_number":157,"context_line":"        \"\"\"Force-remove a given file as root."},{"line_number":158,"context_line":"        Do not raise an exception on failure."},{"line_number":159,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_56af63e3","line":156,"in_reply_to":"ba7be1f8_5613e35b","updated":"2015-02-21 19:09:41.000000000","message":"Still I\u0027d keep the close() here as seatbelt - especially if this got ever moved to a utility module. We want to make sure it has been released before deleting it. Closing a file more then once is a no-op.","commit_id":"790d7624ed92630882259da9cf1576a6c61b2520"},{"author":{"_account_id":13355,"name":"Edmond Kotowski","email":"ekotowski@gmail.com","username":"ekotowski"},"change_message_id":"7c60e523f9f868b1b47ad51669124228eef58559","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        return None"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    @classmethod"},{"line_number":156,"context_line":"    def _delete_temp_file(self, fp):"},{"line_number":157,"context_line":"        \"\"\"Force-remove a given file as root."},{"line_number":158,"context_line":"        Do not raise an exception on failure."},{"line_number":159,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_f6bbf7c1","line":156,"in_reply_to":"ba7be1f8_56af63e3","updated":"2015-02-21 20:14:17.000000000","message":"If this was in a utility class then I would expect to just pass a file name into it and it would handle everything. I would say delete_temp_file(\u0027/var/foo.log\u0027) and it would delete it.","commit_id":"790d7624ed92630882259da9cf1576a6c61b2520"},{"author":{"_account_id":10215,"name":"Peter Stachowski","email":"peter@tesora.com","username":"peterstac"},"change_message_id":"ce869bc620134a30484ea9ca27489525c0019c15","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        return None"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    @classmethod"},{"line_number":156,"context_line":"    def _delete_temp_file(self, fp):"},{"line_number":157,"context_line":"        \"\"\"Force-remove a given file as root."},{"line_number":158,"context_line":"        Do not raise an exception on failure."},{"line_number":159,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_110a5521","line":156,"in_reply_to":"ba7be1f8_b6f97f4f","updated":"2015-02-21 21:47:52.000000000","message":"I did a quick search through the code and couldn\u0027t find any.  Have to say, I\u0027m *not* surprised.","commit_id":"790d7624ed92630882259da9cf1576a6c61b2520"},{"author":{"_account_id":13355,"name":"Edmond Kotowski","email":"ekotowski@gmail.com","username":"ekotowski"},"change_message_id":"cc04a4b2ec9a523624c98f1216f8ea8a3488e1aa","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        return None"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    @classmethod"},{"line_number":156,"context_line":"    def _delete_temp_file(self, fp):"},{"line_number":157,"context_line":"        \"\"\"Force-remove a given file as root."},{"line_number":158,"context_line":"        Do not raise an exception on failure."},{"line_number":159,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_b6f97f4f","line":156,"in_reply_to":"ba7be1f8_f6bbf7c1","updated":"2015-02-21 20:48:00.000000000","message":"Is there not already a delete file with as root function? I was just thinking this could basically be delete_file_as_root(self, file_name). I would be surprised if we don\u0027t already have this.","commit_id":"790d7624ed92630882259da9cf1576a6c61b2520"},{"author":{"_account_id":13355,"name":"Edmond Kotowski","email":"ekotowski@gmail.com","username":"ekotowski"},"change_message_id":"1edf1778258bbe157edee5cc566d2a9b81eb9603","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                self._start_mysqld_safe_with_init_file(init_file, err_log_file)"},{"line_number":140,"context_line":"            finally:"},{"line_number":141,"context_line":"                err_log_file.close()"},{"line_number":142,"context_line":"                MySQLRestoreMixin._delete_temp_file(err_log_file)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def _writelines_one_per_line(self, fp, lines):"},{"line_number":145,"context_line":"        fp.write(os.linesep.join(lines))"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_a647661c","line":142,"updated":"2015-02-23 21:48:51.000000000","message":"Just inject the name here, MySQLRestoreMixin._delete_temp_file(err_log_file.name) because that is all you are using in the method","commit_id":"7be13f7897d22a1b541ec4e6766e1d1121aa9bf6"},{"author":{"_account_id":13355,"name":"Edmond Kotowski","email":"ekotowski@gmail.com","username":"ekotowski"},"change_message_id":"1edf1778258bbe157edee5cc566d2a9b81eb9603","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        return None"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    @classmethod"},{"line_number":157,"context_line":"    def _delete_temp_file(self, fp):"},{"line_number":158,"context_line":"        \"\"\"Force-remove a given file as root."},{"line_number":159,"context_line":"        Do not raise an exception on failure."},{"line_number":160,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_867d021f","line":157,"updated":"2015-02-23 21:48:51.000000000","message":"Some possible more descriptive  names:\n_delete_file_as_root(self, file_path) or\n_delete_file(self, file_path)\n\nIt just so happens when you call it you are using a temp file. If I want to use this for deleting a non temp file I still could. That\u0027s why I don\u0027t think the temp part is necessary.","commit_id":"7be13f7897d22a1b541ec4e6766e1d1121aa9bf6"},{"author":{"_account_id":13355,"name":"Edmond Kotowski","email":"ekotowski@gmail.com","username":"ekotowski"},"change_message_id":"1edf1778258bbe157edee5cc566d2a9b81eb9603","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        \"\"\"Force-remove a given file as root."},{"line_number":159,"context_line":"        Do not raise an exception on failure."},{"line_number":160,"context_line":"        \"\"\""},{"line_number":161,"context_line":"        _file_path \u003d fp.name"},{"line_number":162,"context_line":"        try:"},{"line_number":163,"context_line":"            fp.close()"},{"line_number":164,"context_line":"            utils.execute_with_timeout(\"rm\", \"-f\", _file_path,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_465a2af4","line":161,"updated":"2015-02-23 21:48:51.000000000","message":"Just pass in file_path that way you can remove this variable declaration.","commit_id":"7be13f7897d22a1b541ec4e6766e1d1121aa9bf6"},{"author":{"_account_id":13355,"name":"Edmond Kotowski","email":"ekotowski@gmail.com","username":"ekotowski"},"change_message_id":"1edf1778258bbe157edee5cc566d2a9b81eb9603","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        \"\"\""},{"line_number":161,"context_line":"        _file_path \u003d fp.name"},{"line_number":162,"context_line":"        try:"},{"line_number":163,"context_line":"            fp.close()"},{"line_number":164,"context_line":"            utils.execute_with_timeout(\"rm\", \"-f\", _file_path,"},{"line_number":165,"context_line":"                                       run_as_root\u003dTrue,"},{"line_number":166,"context_line":"                                       root_helper\u003d\"sudo\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_06911247","line":163,"updated":"2015-02-23 21:48:51.000000000","message":"This line can be deleted since you are closing this outside of this scope.","commit_id":"7be13f7897d22a1b541ec4e6766e1d1121aa9bf6"},{"author":{"_account_id":13355,"name":"Edmond Kotowski","email":"ekotowski@gmail.com","username":"ekotowski"},"change_message_id":"e53b061e47c9722e05f9beaef44b9649fba4c167","unresolved":false,"context_lines":[{"line_number":165,"context_line":"                                       run_as_root\u003dTrue,"},{"line_number":166,"context_line":"                                       root_helper\u003d\"sudo\")"},{"line_number":167,"context_line":"        except Exception:"},{"line_number":168,"context_line":"            LOG.debug(\"Could not remove temporary file: \u0027%s\u0027\" % _file_path)"},{"line_number":169,"context_line":"            pass"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_5373c77f","line":168,"updated":"2015-02-23 22:22:50.000000000","message":"I would also LOG.exception here to make sure we get the stack trace because it could be useful for diagnosis.","commit_id":"7be13f7897d22a1b541ec4e6766e1d1121aa9bf6"}],"trove/tests/unittests/backup/test_backupagent.py":[{"author":{"_account_id":10215,"name":"Peter Stachowski","email":"peter@tesora.com","username":"peterstac"},"change_message_id":"479ba5657dbb4656fed27a5e41b5f8b2f32ac733","unresolved":false,"context_lines":[{"line_number":437,"context_line":"                AttributeError,"},{"line_number":438,"context_line":"                agent.execute_backup, TroveContext(), bkup_info, \u0027location\u0027)"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    def test_reset_root_password_on_mysql_restore(self):"},{"line_number":441,"context_line":"        with patch.object(utils, \u0027execute_with_timeout\u0027,"},{"line_number":442,"context_line":"                          return_value\u003dTrue) as exec_call:"},{"line_number":443,"context_line":"            with patch.object(MySQLRestoreMixin,"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba7be1f8_4a0bda7c","line":440,"updated":"2015-02-24 21:34:54.000000000","message":"Looks like this method is duped","commit_id":"192022b0dd0f9e03a315515882b46f2fca3df5e2"}]}
