)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"65d609acc798e39d1832106f1aed58bdb07d33be","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix the mysql start up issue after restore"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When trove-guestagent resets the root password after the mysql restore,"},{"line_number":10,"context_line":"mysqld-safe fails to start the mysql process because init-file is not allowed"},{"line_number":11,"context_line":"for non-mysql user to access by apparmor(for ubuntu)."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Changing init-file ownership fixes this problem and makes the backup and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_b19dca6d","line":10,"range":{"start_line":10,"start_character":70,"end_line":10,"end_character":77},"updated":"2018-09-26 10:30:51.000000000","message":"Please, wrap the lines to 72 characters in compliance with OpenStack Git commit good practice [1].\n\n[1] https://wiki.openstack.org/wiki/GitCommitMessages#Summary_of_Git_commit_message_structure","commit_id":"e3d6d3121b375e609eaff3b263006d2241b2afc9"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"65d609acc798e39d1832106f1aed58bdb07d33be","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When trove-guestagent resets the root password after the mysql restore,"},{"line_number":10,"context_line":"mysqld-safe fails to start the mysql process because init-file is not allowed"},{"line_number":11,"context_line":"for non-mysql user to access by apparmor(for ubuntu)."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Changing init-file ownership fixes this problem and makes the backup and"},{"line_number":14,"context_line":"restore successful."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_0319d578","line":11,"updated":"2018-09-26 10:30:51.000000000","message":"I have doubts whether the cause of problem described in the commit message is correct. I have a strong suspicion that the main problem here is the way of building the image.\n\nThe official elements for MySQL existing in this repository are built with the appropriate configuration for AppArmour [1], in which the mysqld service gets write and read permissions on /tmp directory. Guest user creates temporary init-file inside this directory, so the mysqld process should have access.\n\nPlease note that functional tests to restore the backup have been going smoothly. Maybe there is a subtle difference for Bionic. In that case we should investigate this issue further.\n\nAnyway, I think the change is justified, because not everyone builds images from the official repository. Since we create files in the runtime, we should also take care of the appropriate permissions for them.\n\nPlease, update the commit message if I\u0027m right or provide more details so that we could understand the cause.\n\n[1] https://github.com/openstack/trove/blob/9b7c7eed20a3adf1b6964b57e74fd8d2fb5b7e6c/integration/scripts/files/elements/ubuntu-mysql/pre-install.d/20-apparmor-mysql-local#L10","commit_id":"e3d6d3121b375e609eaff3b263006d2241b2afc9"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"19fdd0366a376eb15c2926cbe93309a5e2e16e8b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix the mysql start up issue after restore"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When the trove guest image is built without the proper permission"},{"line_number":10,"context_line":"setting (could happen when using non-official ways of image building),"},{"line_number":11,"context_line":"the trove-guestagent will fail to reset the root password after"},{"line_number":12,"context_line":"mysql restore, which fails the whole mysql restore procedure."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f79a3b5_e386e316","line":10,"range":{"start_line":9,"start_character":55,"end_line":10,"end_character":7},"updated":"2018-09-28 11:05:31.000000000","message":"Add: \"for /tmp directory in which init file is created\"","commit_id":"a05b5c9ff638163ff51e3056e2e662ad2e2d1d6e"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"19fdd0366a376eb15c2926cbe93309a5e2e16e8b","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When the trove guest image is built without the proper permission"},{"line_number":10,"context_line":"setting (could happen when using non-official ways of image building),"},{"line_number":11,"context_line":"the trove-guestagent will fail to reset the root password after"},{"line_number":12,"context_line":"mysql restore, which fails the whole mysql restore procedure."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Changing init-file ownership fixes this problem and makes the backup and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f79a3b5_c398876a","line":11,"range":{"start_line":11,"start_character":4,"end_line":11,"end_character":20},"updated":"2018-09-28 11:05:31.000000000","message":"Change to: \"mysql_safe will fail\"","commit_id":"a05b5c9ff638163ff51e3056e2e662ad2e2d1d6e"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"19fdd0366a376eb15c2926cbe93309a5e2e16e8b","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When the trove guest image is built without the proper permission"},{"line_number":10,"context_line":"setting (could happen when using non-official ways of image building),"},{"line_number":11,"context_line":"the trove-guestagent will fail to reset the root password after"},{"line_number":12,"context_line":"mysql restore, which fails the whole mysql restore procedure."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Changing init-file ownership fixes this problem and makes the backup and"},{"line_number":15,"context_line":"restore successful."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f79a3b5_23a93b7b","line":12,"range":{"start_line":12,"start_character":6,"end_line":12,"end_character":13},"updated":"2018-09-28 11:05:31.000000000","message":"Add: \"due to AppArmour complaints\"","commit_id":"a05b5c9ff638163ff51e3056e2e662ad2e2d1d6e"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"19fdd0366a376eb15c2926cbe93309a5e2e16e8b","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When the trove guest image is built without the proper permission"},{"line_number":10,"context_line":"setting (could happen when using non-official ways of image building),"},{"line_number":11,"context_line":"the trove-guestagent will fail to reset the root password after"},{"line_number":12,"context_line":"mysql restore, which fails the whole mysql restore procedure."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Changing init-file ownership fixes this problem and makes the backup and"},{"line_number":15,"context_line":"restore successful."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f79a3b5_e3b4a3d6","line":12,"range":{"start_line":12,"start_character":15,"end_line":12,"end_character":20},"updated":"2018-09-28 11:05:31.000000000","message":"Change to: \"As a consequence it fails...\"","commit_id":"a05b5c9ff638163ff51e3056e2e662ad2e2d1d6e"}],"trove/guestagent/strategies/restore/mysql_impl.py":[{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"65d609acc798e39d1832106f1aed58bdb07d33be","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        \"\"\""},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        try:"},{"line_number":140,"context_line":"            # Do not attempt to delete the file as the \u0027trove\u0027 user."},{"line_number":141,"context_line":"            # The process writing into it may have assumed its ownership."},{"line_number":142,"context_line":"            # Only owners can delete temporary"},{"line_number":143,"context_line":"            # files (restricted deletion)."}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_b1b4ead5","line":140,"range":{"start_line":140,"start_character":39,"end_line":140,"end_character":42},"updated":"2018-09-26 10:30:51.000000000","message":"Indicate that the comment relates to both files, e.g. \"the file\" -\u003e \"these files\".","commit_id":"e3d6d3121b375e609eaff3b263006d2241b2afc9"},{"author":{"_account_id":26721,"name":"Rocky","display_name":"Shi Yan","email":"yanshi.403@gmail.com","username":"Rocky"},"change_message_id":"636560b1b7fb144c65d369fbd13450f78d042d4b","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        \"\"\""},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        try:"},{"line_number":140,"context_line":"            # Do not attempt to delete the file as the \u0027trove\u0027 user."},{"line_number":141,"context_line":"            # The process writing into it may have assumed its ownership."},{"line_number":142,"context_line":"            # Only owners can delete temporary"},{"line_number":143,"context_line":"            # files (restricted deletion)."}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_2475e533","line":140,"range":{"start_line":140,"start_character":39,"end_line":140,"end_character":42},"in_reply_to":"3f79a3b5_b1b4ead5","updated":"2018-09-27 05:38:30.000000000","message":"Done","commit_id":"e3d6d3121b375e609eaff3b263006d2241b2afc9"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"65d609acc798e39d1832106f1aed58bdb07d33be","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            # Do not attempt to delete the file as the \u0027trove\u0027 user."},{"line_number":141,"context_line":"            # The process writing into it may have assumed its ownership."},{"line_number":142,"context_line":"            # Only owners can delete temporary"},{"line_number":143,"context_line":"            # files (restricted deletion)."},{"line_number":144,"context_line":"            init_file \u003d tempfile.NamedTemporaryFile(mode\u003d\u0027w\u0027, delete\u003dFalse)"},{"line_number":145,"context_line":"            operating_system.write_file(init_file.name,"},{"line_number":146,"context_line":"                                        self.RESET_ROOT_MYSQL_COMMANDS)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_d1dc0619","line":143,"updated":"2018-09-26 10:30:51.000000000","message":"By the way, two last lines can be merged together into single line.","commit_id":"e3d6d3121b375e609eaff3b263006d2241b2afc9"},{"author":{"_account_id":26721,"name":"Rocky","display_name":"Shi Yan","email":"yanshi.403@gmail.com","username":"Rocky"},"change_message_id":"636560b1b7fb144c65d369fbd13450f78d042d4b","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            # Do not attempt to delete the file as the \u0027trove\u0027 user."},{"line_number":141,"context_line":"            # The process writing into it may have assumed its ownership."},{"line_number":142,"context_line":"            # Only owners can delete temporary"},{"line_number":143,"context_line":"            # files (restricted deletion)."},{"line_number":144,"context_line":"            init_file \u003d tempfile.NamedTemporaryFile(mode\u003d\u0027w\u0027, delete\u003dFalse)"},{"line_number":145,"context_line":"            operating_system.write_file(init_file.name,"},{"line_number":146,"context_line":"                                        self.RESET_ROOT_MYSQL_COMMANDS)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_c473d14d","line":143,"in_reply_to":"3f79a3b5_d1dc0619","updated":"2018-09-27 05:38:30.000000000","message":"Done","commit_id":"e3d6d3121b375e609eaff3b263006d2241b2afc9"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"19fdd0366a376eb15c2926cbe93309a5e2e16e8b","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        if not os.path.exists(run_dir):"},{"line_number":84,"context_line":"            utils.execute(\"mkdir\", run_dir,"},{"line_number":85,"context_line":"                          run_as_root\u003dTrue, root_helper\u003d\"sudo\")"},{"line_number":86,"context_line":"            utils.execute(\"chown\", \"mysql:mysql\", run_dir, err_log_file.name,"},{"line_number":87,"context_line":"                          init_file.name, run_as_root\u003dTrue, root_helper\u003d\"sudo\")"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        child \u003d pexpect.spawn("}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_0d2b10ea","line":86,"updated":"2018-09-28 11:05:31.000000000","message":"We should only make missing dir in the scope of this condition. Let\u0027s chown outside to ensure we add appropriate permissions regardless of the presence of run dir.","commit_id":"a05b5c9ff638163ff51e3056e2e662ad2e2d1d6e"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"ddfe1c11cb508afe6c1f8438b9998f1c02d37345","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          run_as_root\u003dTrue, root_helper\u003d\"sudo\")"},{"line_number":86,"context_line":"            utils.execute(\"chown\", \"mysql:mysql\", run_dir,"},{"line_number":87,"context_line":"                          run_as_root\u003dTrue, root_helper\u003d\"sudo\")"},{"line_number":88,"context_line":"            utils.execute(\"chown\", \"mysql:mysql\", err_log_file.name,"},{"line_number":89,"context_line":"                          init_file.name, run_as_root\u003dTrue, root_helper\u003d\"sudo\")"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        child \u003d pexpect.spawn("}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_1dac7333","line":88,"updated":"2018-10-01 09:02:28.000000000","message":"There was nothing wrong with assigning ownership for these files in single invocation.\n\nI was rather suggesting un-nesting it so that we chown permissions regardless of the presence of run directory.\n\nSomething like this:\n\n if not run_dir:\n     mkdir run_dir\n chown mysql run_dir, err_log, ini_file","commit_id":"3df718b9d513071e8c897674f9fc6c3455e82786"},{"author":{"_account_id":26721,"name":"Rocky","display_name":"Shi Yan","email":"yanshi.403@gmail.com","username":"Rocky"},"change_message_id":"cb43b72c7484f2f4d83a8a599a45526453d6ec8a","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          run_as_root\u003dTrue, root_helper\u003d\"sudo\")"},{"line_number":86,"context_line":"            utils.execute(\"chown\", \"mysql:mysql\", run_dir,"},{"line_number":87,"context_line":"                          run_as_root\u003dTrue, root_helper\u003d\"sudo\")"},{"line_number":88,"context_line":"            utils.execute(\"chown\", \"mysql:mysql\", err_log_file.name,"},{"line_number":89,"context_line":"                          init_file.name, run_as_root\u003dTrue, root_helper\u003d\"sudo\")"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        child \u003d pexpect.spawn("}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_c1c047e3","line":88,"in_reply_to":"3f79a3b5_1dac7333","updated":"2018-10-01 23:19:04.000000000","message":"I see, Thanks!","commit_id":"3df718b9d513071e8c897674f9fc6c3455e82786"}],"trove/tests/unittests/guestagent/test_backups.py":[{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"65d609acc798e39d1832106f1aed58bdb07d33be","unresolved":false,"context_lines":[{"line_number":356,"context_line":"            chmod.assert_called_once_with("},{"line_number":357,"context_line":"                ANY, operating_system.FileMode.ADD_READ_ALL, as_root\u003dTrue)"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"            # Make sure the temporary error log got deleted as root"},{"line_number":360,"context_line":"            # (see bug/1423759)."},{"line_number":361,"context_line":"            remove_calls \u003d [call(ANY, force\u003dTrue, as_root\u003dTrue),"},{"line_number":362,"context_line":"                            call(ANY, force\u003dTrue, as_root\u003dTrue)]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_11403ea2","line":359,"range":{"start_line":359,"start_character":28,"end_line":359,"end_character":47},"updated":"2018-09-26 10:30:51.000000000","message":"Generalize the comment, e.g. \"temporary error log\" -\u003e \"temporary files\".","commit_id":"e3d6d3121b375e609eaff3b263006d2241b2afc9"},{"author":{"_account_id":26721,"name":"Rocky","display_name":"Shi Yan","email":"yanshi.403@gmail.com","username":"Rocky"},"change_message_id":"636560b1b7fb144c65d369fbd13450f78d042d4b","unresolved":false,"context_lines":[{"line_number":356,"context_line":"            chmod.assert_called_once_with("},{"line_number":357,"context_line":"                ANY, operating_system.FileMode.ADD_READ_ALL, as_root\u003dTrue)"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"            # Make sure the temporary error log got deleted as root"},{"line_number":360,"context_line":"            # (see bug/1423759)."},{"line_number":361,"context_line":"            remove_calls \u003d [call(ANY, force\u003dTrue, as_root\u003dTrue),"},{"line_number":362,"context_line":"                            call(ANY, force\u003dTrue, as_root\u003dTrue)]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_a48ed523","line":359,"range":{"start_line":359,"start_character":28,"end_line":359,"end_character":47},"in_reply_to":"3f79a3b5_11403ea2","updated":"2018-09-27 05:38:30.000000000","message":"Done","commit_id":"e3d6d3121b375e609eaff3b263006d2241b2afc9"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"65d609acc798e39d1832106f1aed58bdb07d33be","unresolved":false,"context_lines":[{"line_number":359,"context_line":"            # Make sure the temporary error log got deleted as root"},{"line_number":360,"context_line":"            # (see bug/1423759)."},{"line_number":361,"context_line":"            remove_calls \u003d [call(ANY, force\u003dTrue, as_root\u003dTrue),"},{"line_number":362,"context_line":"                            call(ANY, force\u003dTrue, as_root\u003dTrue)]"},{"line_number":363,"context_line":"            remove.assert_has_calls(remove_calls)"},{"line_number":364,"context_line":""},{"line_number":365,"context_line":"    @mock.patch.object(ImportOverrideStrategy, \u0027_initialize_import_directory\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_91ff6e65","line":362,"updated":"2018-09-26 10:30:51.000000000","message":"Provide exact values instead of ANY.","commit_id":"e3d6d3121b375e609eaff3b263006d2241b2afc9"},{"author":{"_account_id":26721,"name":"Rocky","display_name":"Shi Yan","email":"yanshi.403@gmail.com","username":"Rocky"},"change_message_id":"636560b1b7fb144c65d369fbd13450f78d042d4b","unresolved":false,"context_lines":[{"line_number":359,"context_line":"            # Make sure the temporary error log got deleted as root"},{"line_number":360,"context_line":"            # (see bug/1423759)."},{"line_number":361,"context_line":"            remove_calls \u003d [call(ANY, force\u003dTrue, as_root\u003dTrue),"},{"line_number":362,"context_line":"                            call(ANY, force\u003dTrue, as_root\u003dTrue)]"},{"line_number":363,"context_line":"            remove.assert_has_calls(remove_calls)"},{"line_number":364,"context_line":""},{"line_number":365,"context_line":"    @mock.patch.object(ImportOverrideStrategy, \u0027_initialize_import_directory\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_84b4f9d5","line":362,"in_reply_to":"3f79a3b5_91ff6e65","updated":"2018-09-27 05:38:30.000000000","message":"I cannot use the exact filename here, because the mysql_impl code uses \"tempfile\" to randomly generate the filename.","commit_id":"e3d6d3121b375e609eaff3b263006d2241b2afc9"},{"author":{"_account_id":28695,"name":"Bartosz Zurkowski","email":"b.zurkowski@samsung.com","username":"b.zurkowski"},"change_message_id":"19fdd0366a376eb15c2926cbe93309a5e2e16e8b","unresolved":false,"context_lines":[{"line_number":360,"context_line":"            # (see bug/1423759)."},{"line_number":361,"context_line":"            remove_calls \u003d [call(ANY, force\u003dTrue, as_root\u003dTrue),"},{"line_number":362,"context_line":"                            call(ANY, force\u003dTrue, as_root\u003dTrue)]"},{"line_number":363,"context_line":"            remove.assert_has_calls(remove_calls)"},{"line_number":364,"context_line":""},{"line_number":365,"context_line":"    @mock.patch.object(ImportOverrideStrategy, \u0027_initialize_import_directory\u0027)"},{"line_number":366,"context_line":"    def test_backup_encrypted_mongodump_command(self, _):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_cde9987f","line":363,"updated":"2018-09-28 11:05:31.000000000","message":"Since both calls are the same, we can reduce the code:\n\n remove.assert_has_calls(\n    2 * [call(ANY, force\u003dTrue, as_root\u003dTrue)])","commit_id":"a05b5c9ff638163ff51e3056e2e662ad2e2d1d6e"}]}
