)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9664,"name":"amrith","email":"amrith.kumar@gmail.com","username":"amrith"},"change_message_id":"87d056058a65e3affbbec915e8bea27458c2d3d8","unresolved":false,"context_lines":[{"line_number":34,"context_line":"We also check for errors in the password-reset stage,"},{"line_number":35,"context_line":"so that a proper error message (including cause) can be logged."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"Tested with MySQL  5.5/5.6 and Percona"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"Closes-Bug: 1419995"},{"line_number":40,"context_line":"Change-Id: I86777c4177cb46d61573c564335b529d7a1da52a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"da86d52c_7815f6e3","line":37,"updated":"2015-02-10 18:50:44.000000000","message":"Petr, kudos for the well written and highly descriptive commit message!","commit_id":"3b009361a1e4f040ad165281198bddda8452821a"}],"trove/guestagent/strategies/restore/mysql_impl.py":[{"author":{"_account_id":10266,"name":"Simon Chang","email":"schang@tesora.com","username":"changsimon"},"change_message_id":"703990b7e228725611a11f74d53f103ac51a2c28","unresolved":false,"context_lines":[{"line_number":19,"context_line":"import pexpect"},{"line_number":20,"context_line":"import tempfile"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"import re"},{"line_number":23,"context_line":"from trove.guestagent.strategies.restore import base"},{"line_number":24,"context_line":"from trove.openstack.common import log as logging"},{"line_number":25,"context_line":"from trove.common import exception"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_42ecea29","line":22,"updated":"2015-02-09 23:51:40.000000000","message":"Minor formatting issue. Put this \"re\" import before the \"tempfile\" import.","commit_id":"3b009361a1e4f040ad165281198bddda8452821a"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"236df0c040e42a040a9499e7e9a7c22f2ca1e03e","unresolved":false,"context_lines":[{"line_number":19,"context_line":"import pexpect"},{"line_number":20,"context_line":"import tempfile"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"import re"},{"line_number":23,"context_line":"from trove.guestagent.strategies.restore import base"},{"line_number":24,"context_line":"from trove.openstack.common import log as logging"},{"line_number":25,"context_line":"from trove.common import exception"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_99dc9576","line":22,"in_reply_to":"da86d52c_42ecea29","updated":"2015-02-10 02:33:53.000000000","message":"+1","commit_id":"3b009361a1e4f040ad165281198bddda8452821a"},{"author":{"_account_id":10266,"name":"Simon Chang","email":"schang@tesora.com","username":"changsimon"},"change_message_id":"703990b7e228725611a11f74d53f103ac51a2c28","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    # the \u0027--log-error\u0027 startup parameter."},{"line_number":48,"context_line":"    _ERROR_LOG_SUFFIX \u003d \u0027.err\u0027"},{"line_number":49,"context_line":"    _ERROR_MESSAGE_PATTERN \u003d re.compile(\"^ERROR:\\s+.+$\")"},{"line_number":50,"context_line":"    _NEWLINE \u003d \u0027\\n\u0027"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def mysql_is_running(self):"},{"line_number":53,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_3f1b9181","line":50,"updated":"2015-02-09 23:51:40.000000000","message":"os.linesep is \\n","commit_id":"3b009361a1e4f040ad165281198bddda8452821a"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"236df0c040e42a040a9499e7e9a7c22f2ca1e03e","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    # the \u0027--log-error\u0027 startup parameter."},{"line_number":48,"context_line":"    _ERROR_LOG_SUFFIX \u003d \u0027.err\u0027"},{"line_number":49,"context_line":"    _ERROR_MESSAGE_PATTERN \u003d re.compile(\"^ERROR:\\s+.+$\")"},{"line_number":50,"context_line":"    _NEWLINE \u003d \u0027\\n\u0027"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def mysql_is_running(self):"},{"line_number":53,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_79f601fb","line":50,"in_reply_to":"da86d52c_3f1b9181","updated":"2015-02-10 02:33:53.000000000","message":"+1","commit_id":"3b009361a1e4f040ad165281198bddda8452821a"},{"author":{"_account_id":10266,"name":"Simon Chang","email":"schang@tesora.com","username":"changsimon"},"change_message_id":"703990b7e228725611a11f74d53f103ac51a2c28","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            if first_err_message:"},{"line_number":104,"context_line":"                raise base.RestoreError(\"Reset root password failed: %s\""},{"line_number":105,"context_line":"                                        % first_err_message)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"            LOG.info(_(\"Root password reset successfully.\"))"},{"line_number":108,"context_line":"            LOG.debug(\"Cleaning up the temp mysqld process.\")"},{"line_number":109,"context_line":"            utils.execute_with_timeout(\"mysqladmin\", \"-uroot\", \"shutdown\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_5fb6858b","line":106,"updated":"2015-02-09 23:51:40.000000000","message":"Is the error log file going to be big? Can the \"real error\" be nested under the first one? Should we crawl the whole file and report all the errors?","commit_id":"3b009361a1e4f040ad165281198bddda8452821a"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"236df0c040e42a040a9499e7e9a7c22f2ca1e03e","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            if first_err_message:"},{"line_number":104,"context_line":"                raise base.RestoreError(\"Reset root password failed: %s\""},{"line_number":105,"context_line":"                                        % first_err_message)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"            LOG.info(_(\"Root password reset successfully.\"))"},{"line_number":108,"context_line":"            LOG.debug(\"Cleaning up the temp mysqld process.\")"},{"line_number":109,"context_line":"            utils.execute_with_timeout(\"mysqladmin\", \"-uroot\", \"shutdown\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_d4fb3445","line":106,"in_reply_to":"da86d52c_5fb6858b","updated":"2015-02-10 02:33:53.000000000","message":"Well, it depends. The log may surely contain more error messages. There would be none from a successful startup.\n\nI was thinking about it and the subsequent error messages are going to be most certainly caused by the first one. I just didn\u0027t want to crowd the log by a chain of errors caused one by another.","commit_id":"3b009361a1e4f040ad165281198bddda8452821a"},{"author":{"_account_id":10266,"name":"Simon Chang","email":"schang@tesora.com","username":"changsimon"},"change_message_id":"703990b7e228725611a11f74d53f103ac51a2c28","unresolved":false,"context_lines":[{"line_number":127,"context_line":"    def reset_root_password(self):"},{"line_number":128,"context_line":"        with tempfile.NamedTemporaryFile() as init_file:"},{"line_number":129,"context_line":"            with tempfile.NamedTemporaryFile("},{"line_number":130,"context_line":"                    suffix\u003dself._ERROR_LOG_SUFFIX) as err_log_file:"},{"line_number":131,"context_line":"                self._writelines_one_per_line(init_file,"},{"line_number":132,"context_line":"                                              self.RESET_ROOT_MYSQL_COMMANDS)"},{"line_number":133,"context_line":"                utils.execute_with_timeout(\"sudo\", \"chmod\", \"a+r\","}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_bf1a2116","line":130,"updated":"2015-02-09 23:51:40.000000000","message":"Maybe this \"with\" for err_log_file should be moved to ...","commit_id":"3b009361a1e4f040ad165281198bddda8452821a"},{"author":{"_account_id":10266,"name":"Simon Chang","email":"schang@tesora.com","username":"changsimon"},"change_message_id":"703990b7e228725611a11f74d53f103ac51a2c28","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                self._writelines_one_per_line(init_file,"},{"line_number":132,"context_line":"                                              self.RESET_ROOT_MYSQL_COMMANDS)"},{"line_number":133,"context_line":"                utils.execute_with_timeout(\"sudo\", \"chmod\", \"a+r\","},{"line_number":134,"context_line":"                                           init_file.name)"},{"line_number":135,"context_line":"                self._start_mysqld_safe_with_init_file(init_file, err_log_file)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def _writelines_one_per_line(self, fp, lines):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_df199523","line":134,"updated":"2015-02-09 23:51:40.000000000","message":"... here? Actually, \"with\" is usually used to wrap a block of code that uses the same resource repeatedly, but I can only see err_log_file being used once in this block.","commit_id":"3b009361a1e4f040ad165281198bddda8452821a"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"236df0c040e42a040a9499e7e9a7c22f2ca1e03e","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                self._writelines_one_per_line(init_file,"},{"line_number":132,"context_line":"                                              self.RESET_ROOT_MYSQL_COMMANDS)"},{"line_number":133,"context_line":"                utils.execute_with_timeout(\"sudo\", \"chmod\", \"a+r\","},{"line_number":134,"context_line":"                                           init_file.name)"},{"line_number":135,"context_line":"                self._start_mysqld_safe_with_init_file(init_file, err_log_file)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def _writelines_one_per_line(self, fp, lines):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_19e9851a","line":134,"in_reply_to":"da86d52c_df199523","updated":"2015-02-10 02:33:53.000000000","message":"Yes, moving the inner \u0027with\u0027 block here would minimize the scope of \u0027err_log_file\u0027. +1\n\nIt is used by the \u0027_start_mysqld_safe_with_init_file(...)\u0027 method.\nIt could be moved into that method, but I wanted to keep it together with the other file operation.\nThat way the method just takes input and output files and does not need to manage any other resources itself.","commit_id":"3b009361a1e4f040ad165281198bddda8452821a"}]}
