)]}'
{"masakarimonitors/processmonitor/process_handler/handle_process.py":[{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"30db2a5ed243cfd825e54c95f7319b67cd75fbfa","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _make_event(self, process_name):"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        # bug/1858757, reset nova-compute process name."},{"line_number":126,"context_line":"        if \u0027nova-compute\u0027 in process_name:"},{"line_number":127,"context_line":"            process_name \u003d \u0027nova-compute\u0027"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        hostname \u003d socket.gethostname()"},{"line_number":130,"context_line":"        current_time \u003d timeutils.utcnow()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1fa4df85_2c2cee00","line":127,"range":{"start_line":125,"start_character":8,"end_line":127,"end_character":41},"updated":"2020-03-02 03:55:31.000000000","message":"This patch fixes the said issue, but how about changing the process name in process_list.yaml from \"/usr/local/bin/nova-compute\" to \"nova-compute\"?\n\nIn monitor_processes method, instead of executing command using \"ps -ef\", you can use \"ps -el\".\n\nThis way, you can eliminate hard coding in the code.","commit_id":"d8fa5ef353f8b4c65c894e1b0e60b4e9c241e4fa"},{"author":{"_account_id":24501,"name":"sue","display_name":"suzhengwei","email":"sugar-2008@163.com","username":"suzhengwei"},"change_message_id":"f97b6f3b3248f9e3277522c122829cabe4cd4da5","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _make_event(self, process_name):"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        # bug/1858757, reset nova-compute process name."},{"line_number":126,"context_line":"        if \u0027nova-compute\u0027 in process_name:"},{"line_number":127,"context_line":"            process_name \u003d \u0027nova-compute\u0027"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        hostname \u003d socket.gethostname()"},{"line_number":130,"context_line":"        current_time \u003d timeutils.utcnow()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1fa4df85_79728f7d","line":127,"range":{"start_line":125,"start_character":8,"end_line":127,"end_character":41},"in_reply_to":"1fa4df85_2c2cee00","updated":"2020-03-03 03:37:09.000000000","message":"If using \u0027nova-compute\u0027, it would not always locate to the process. For example, it maybe locates to the log collection service.\nI think it is better to use the absolute path of the process.","commit_id":"d8fa5ef353f8b4c65c894e1b0e60b4e9c241e4fa"},{"author":{"_account_id":24501,"name":"sue","display_name":"suzhengwei","email":"sugar-2008@163.com","username":"suzhengwei"},"change_message_id":"aa65859a730950174472df4e9857be4ca47aa86f","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _make_event(self, process_name):"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        # bug/1858757, reset nova-compute process name."},{"line_number":126,"context_line":"        if \u0027nova-compute\u0027 in process_name:"},{"line_number":127,"context_line":"            process_name \u003d \u0027nova-compute\u0027"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        hostname \u003d socket.gethostname()"},{"line_number":130,"context_line":"        current_time \u003d timeutils.utcnow()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1fa4df85_8cf2d999","line":127,"range":{"start_line":125,"start_character":8,"end_line":127,"end_character":41},"in_reply_to":"1fa4df85_58bef6ff","updated":"2020-03-17 07:42:40.000000000","message":"That\u0027s a good suggestion.","commit_id":"d8fa5ef353f8b4c65c894e1b0e60b4e9c241e4fa"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"eca56f0236483da20c136ac28b91419ab3c58880","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _make_event(self, process_name):"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        # bug/1858757, reset nova-compute process name."},{"line_number":126,"context_line":"        if \u0027nova-compute\u0027 in process_name:"},{"line_number":127,"context_line":"            process_name \u003d \u0027nova-compute\u0027"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        hostname \u003d socket.gethostname()"},{"line_number":130,"context_line":"        current_time \u003d timeutils.utcnow()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1fa4df85_58bef6ff","line":127,"range":{"start_line":125,"start_character":8,"end_line":127,"end_character":41},"in_reply_to":"1fa4df85_79728f7d","updated":"2020-03-14 04:24:33.000000000","message":"You are right.\n\nThen, the other option available is tokenizing based on \u0027/\u0027 and send the last token as process_name in the notification So that you don\u0027t need to hard code \u0027nova-compute\u0027.","commit_id":"d8fa5ef353f8b4c65c894e1b0e60b4e9c241e4fa"}],"masakarimonitors/tests/unit/processmonitor/process_handler/test_handle_process.py":[{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"903388dab3afa582f372673d009a7d84bd3d9805","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        self.assertEqual(process_list, obj.process_list)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def test_process_name(self):"},{"line_number":91,"context_line":"        process_name \u003d \"/usr/local/bin/nova-compute\""},{"line_number":92,"context_line":"        obj \u003d handle_process.HandleProcess()"},{"line_number":93,"context_line":"        event \u003d obj._make_event(process_name)"},{"line_number":94,"context_line":"        self.assertEqual("}],"source_content_type":"text/x-python","patch_set":4,"id":"df33271e_efc2c433","line":91,"range":{"start_line":91,"start_character":23,"end_line":91,"end_character":52},"updated":"2020-03-31 13:21:57.000000000","message":"1) Rename this test to test_make_event as your intention is to test_make_event method.\n\n2) You can use ddt to test two scenarios-\n\nSomething like this:-\n\n@ddt.data(\"/usr/local/bin/nova-compute\", \"nova-compute\")\ndef test_process_name(self, process_name):\n        obj \u003d handle_process.HandleProcess()\n        event \u003d obj._make_event(process_name)\n        self.assertEqual(\n            \u0027nova-compute\u0027,\n            event[\u0027notification\u0027][\u0027payload\u0027][\u0027process_name\u0027])","commit_id":"e57ffc9e3d412f301a6ecf21e12140e3721ca05c"},{"author":{"_account_id":24501,"name":"sue","display_name":"suzhengwei","email":"sugar-2008@163.com","username":"suzhengwei"},"change_message_id":"0e5e458e4221988376951ed91daeb988005148c4","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        self.assertEqual(process_list, obj.process_list)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def test_process_name(self):"},{"line_number":91,"context_line":"        process_name \u003d \"/usr/local/bin/nova-compute\""},{"line_number":92,"context_line":"        obj \u003d handle_process.HandleProcess()"},{"line_number":93,"context_line":"        event \u003d obj._make_event(process_name)"},{"line_number":94,"context_line":"        self.assertEqual("}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_67def96d","line":91,"range":{"start_line":91,"start_character":23,"end_line":91,"end_character":52},"in_reply_to":"df33271e_efc2c433","updated":"2020-04-20 07:55:20.000000000","message":"Done","commit_id":"e57ffc9e3d412f301a6ecf21e12140e3721ca05c"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"903388dab3afa582f372673d009a7d84bd3d9805","unresolved":false,"context_lines":[{"line_number":394,"context_line":"    @mock.patch.object(timeutils, \u0027utcnow\u0027)"},{"line_number":395,"context_line":"    @mock.patch.object(eventlet.greenthread, \u0027sleep\u0027)"},{"line_number":396,"context_line":"    @mock.patch.object(utils, \u0027execute\u0027)"},{"line_number":397,"context_line":"    def test_restart_nova_compute_processes_post_restart_command_retry_over("},{"line_number":398,"context_line":"        self, mock_execute, mock_sleep, mock_utcnow, mock_send_notification):"},{"line_number":399,"context_line":"        process_list \u003d MOCK_PROCESS_LIST"},{"line_number":400,"context_line":"        obj \u003d handle_process.HandleProcess()"}],"source_content_type":"text/x-python","patch_set":4,"id":"df33271e_2a7c9a81","line":397,"range":{"start_line":397,"start_character":8,"end_line":397,"end_character":75},"updated":"2020-03-31 13:21:57.000000000","message":"This unit test code is almost same as test_restart_processes_post_restart_command_retry_over.\n\nso Instead of adding this new test, I will suggest you to update test_restart_processes_post_restart_command_retry_over test by including two processes in MOCK_PROCESS_LIST and MOCK_DOWN_PROCESS_LIST:-\n\n1. change process name from \"mock_process_name_A\" to \"nova-compute\" in both \nMOCK_PROCESS_LIST and MOCK_DOWN_PROCESS_LIST.\n2. /usr/local/bin/nova-compute\n\nso that you can assert process_name at line 448 as \"nova-compute\".","commit_id":"e57ffc9e3d412f301a6ecf21e12140e3721ca05c"},{"author":{"_account_id":24501,"name":"sue","display_name":"suzhengwei","email":"sugar-2008@163.com","username":"suzhengwei"},"change_message_id":"0e5e458e4221988376951ed91daeb988005148c4","unresolved":false,"context_lines":[{"line_number":394,"context_line":"    @mock.patch.object(timeutils, \u0027utcnow\u0027)"},{"line_number":395,"context_line":"    @mock.patch.object(eventlet.greenthread, \u0027sleep\u0027)"},{"line_number":396,"context_line":"    @mock.patch.object(utils, \u0027execute\u0027)"},{"line_number":397,"context_line":"    def test_restart_nova_compute_processes_post_restart_command_retry_over("},{"line_number":398,"context_line":"        self, mock_execute, mock_sleep, mock_utcnow, mock_send_notification):"},{"line_number":399,"context_line":"        process_list \u003d MOCK_PROCESS_LIST"},{"line_number":400,"context_line":"        obj \u003d handle_process.HandleProcess()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_c7d8ad7c","line":397,"range":{"start_line":397,"start_character":8,"end_line":397,"end_character":75},"in_reply_to":"df33271e_2a7c9a81","updated":"2020-04-20 07:55:20.000000000","message":"Done","commit_id":"e57ffc9e3d412f301a6ecf21e12140e3721ca05c"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"9e55fdf251d720a80e17057c29749fa73f8ecdeb","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":13,"context_line":"# limitations under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import ddt"},{"line_number":16,"context_line":"import socket"},{"line_number":17,"context_line":"import testtools"},{"line_number":18,"context_line":"from unittest import mock"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f493fa4_90a4a20a","line":15,"range":{"start_line":15,"start_character":0,"end_line":15,"end_character":10},"updated":"2020-04-20 21:47:57.000000000","message":"ddt is a third party library so include it before line #20.\n\nIn fact, testtools is also a third party library and it should be moved to the third party library section.","commit_id":"7b35a6e9ab1f9eebea98c5d8c83002744de016fb"},{"author":{"_account_id":24501,"name":"sue","display_name":"suzhengwei","email":"sugar-2008@163.com","username":"suzhengwei"},"change_message_id":"502c11b93556a977960152e940f8dd02a1bb999e","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":13,"context_line":"# limitations under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import ddt"},{"line_number":16,"context_line":"import socket"},{"line_number":17,"context_line":"import testtools"},{"line_number":18,"context_line":"from unittest import mock"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f493fa4_a7ffe565","line":15,"range":{"start_line":15,"start_character":0,"end_line":15,"end_character":10},"in_reply_to":"1f493fa4_90a4a20a","updated":"2020-04-21 01:47:06.000000000","message":"Done","commit_id":"7b35a6e9ab1f9eebea98c5d8c83002744de016fb"}]}
