)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"572cac623040fc6fd3e2e5054131fa1d94088146","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Piyush Raman Srivastava \u003cpirsriva@in.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-04-01 05:15:40 +0530"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[WIP] Fix rally task verification log"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"- Fix rally task verification log for FAILED tasks."},{"line_number":10,"context_line":"- Fix inconsistent output of \"rally task detailed\""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9a061dce_a8cfb527","line":7,"updated":"2016-04-06 14:51:09.000000000","message":"Is this a WIP?","commit_id":"ce172da017bfe090477f65c6505926f50f4740ac"}],"rally/cli/commands/task.py":[{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"14b47a02b28816fde64e77099ce6e035de69396a","unresolved":false,"context_lines":[{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        if task[\"status\"] \u003d\u003d consts.TaskStatus.FAILED:"},{"line_number":319,"context_line":"            print(\"-\" * 80)"},{"line_number":320,"context_line":"            verification \u003d yaml.safe_load(task[\"verification_log\"])"},{"line_number":321,"context_line":"            if logging.is_debug():"},{"line_number":322,"context_line":"                print(verification)"},{"line_number":323,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a061dce_99b9ee31","line":320,"updated":"2016-04-04 11:20:57.000000000","message":"you are trying to handle the results of the issue and not to fix the core of it.\n\ntask[\"verification_log\"] should include string with json(pay attention on json.dumps there[1]). The correct format is described here[2].\nThere is just an error message instead of json in case of validation error[3][4].\n\nFirst of all, we should change the interface of set_failed to avoid such mistakes in future. I propose to have separate function arguments for error msg, type of exception and trace instead of one single argument.\nAlso, we need to fix wrong usage of set_failed(validation stuff) and add a hack for old wrong format for existing databases(check that type of verification is not \"string\". in case of string, we need to print it somehow) or(it will be great)  write a db migration[5][6] to convert wrong formats to correct one.\n\n[1] - https://github.com/openstack/rally/blob/0.3.3/rally/common/objects/task.py#L351\n[2] - https://github.com/openstack/rally/blob/0.3.3/rally/task/engine.py#L179-L180\n[3] - https://github.com/openstack/rally/blob/0.3.3/rally/cli/commands/task.py#L132\n[4] - https://github.com/openstack/rally/blob/0.3.3/rally/cli/commands/task.py#L251\n[5] - https://github.com/openstack/rally/tree/0.3.3/rally/common/db/sqlalchemy/migrations\n[6] - https://github.com/openstack/rally/blob/master/rally/common/db/sqlalchemy/migrations/versions/3177d36ea270_merge_credentials_from_users_and_admin.py","commit_id":"736f33ca83b200b35b677620d0cf307b3a855bc5"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"78ac73bcad16d34c1de948de7fa748ae5e56ff02","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                                deployment, task_instance\u003dNone):"},{"line_number":135,"context_line":"        try:"},{"line_number":136,"context_line":"            if not os.path.exists(task) or os.path.isdir(task):"},{"line_number":137,"context_line":"                error_msg \u003d ((\"No such file \u0027%s\u0027\" % task)"},{"line_number":138,"context_line":"                             if task_instance else"},{"line_number":139,"context_line":"                             (\"File \u0027%s\u0027 is not found.\" % task))"},{"line_number":140,"context_line":"                raise IOError(error_msg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a061dce_a47a4b75","line":137,"updated":"2016-04-06 13:29:55.000000000","message":"This could be only one message, there is actually no difference between \"\"No such file \u0027%s\u0027\"\" and \"File \u0027%s\u0027 is not found.\"","commit_id":"46ac7546a4f6d53e83bb77c67f59421ccf612974"},{"author":{"_account_id":20196,"name":"Piyush","email":"piyush2011257@gmail.com","username":"pirsriva"},"change_message_id":"2158ac023588c26aedfd7f9caaea394e54cc3bd3","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                                deployment, task_instance\u003dNone):"},{"line_number":135,"context_line":"        try:"},{"line_number":136,"context_line":"            if not os.path.exists(task) or os.path.isdir(task):"},{"line_number":137,"context_line":"                error_msg \u003d ((\"No such file \u0027%s\u0027\" % task)"},{"line_number":138,"context_line":"                             if task_instance else"},{"line_number":139,"context_line":"                             (\"File \u0027%s\u0027 is not found.\" % task))"},{"line_number":140,"context_line":"                raise IOError(error_msg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a061dce_bcf1bb03","line":137,"in_reply_to":"9a061dce_a47a4b75","updated":"2016-04-06 14:02:39.000000000","message":"Yeah. I dont know how i missed it!!","commit_id":"46ac7546a4f6d53e83bb77c67f59421ccf612974"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"78ac73bcad16d34c1de948de7fa748ae5e56ff02","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                raise IOError(error_msg)"},{"line_number":141,"context_line":"        except IOError as e:"},{"line_number":142,"context_line":"            if task_instance:"},{"line_number":143,"context_line":"                task_instance.set_failed(str(type(e)),"},{"line_number":144,"context_line":"                                         str(e),"},{"line_number":145,"context_line":"                                         json.dumps(traceback.format_exc()))"},{"line_number":146,"context_line":"            raise e"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a061dce_a4cfeb27","line":143,"updated":"2016-04-06 13:29:55.000000000","message":"type(e).__name__ (exception type name) is better than repr format from str(type(e)","commit_id":"46ac7546a4f6d53e83bb77c67f59421ccf612974"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"f577847829d608a879ecabe3fa7a33be1ff17543","unresolved":false,"context_lines":[{"line_number":132,"context_line":"    def _load_and_validate_task(self, task, task_args, task_args_file,"},{"line_number":133,"context_line":"                                deployment, task_instance\u003dNone):"},{"line_number":134,"context_line":"        if not os.path.exists(task) or os.path.isdir(task):"},{"line_number":135,"context_line":"            if task_instance:"},{"line_number":136,"context_line":"                task_instance.set_failed(log\u003d\"No such file \u0027%s\u0027\" % task)"},{"line_number":137,"context_line":"            raise IOError(\"File \u0027%s\u0027 is not found.\" % task)"},{"line_number":138,"context_line":"        input_task \u003d self._load_task(task, task_args, task_args_file)"},{"line_number":139,"context_line":"        api.Task.validate(deployment, input_task, task_instance)"},{"line_number":140,"context_line":"        print(_(\"Task config is valid :)\"))"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a061dce_fcf0bccb","side":"PARENT","line":137,"range":{"start_line":135,"start_character":12,"end_line":137,"end_character":59},"updated":"2016-04-12 06:46:17.000000000","message":"you can replace this code, just with:\n\n    if not os.path.exists(task) or os.path.isdir(task):\n        err_cls \u003d IOError\n        msg \u003d \"File \u0027%s\u0027 is not found.\" % task)\n        if task_instance:\n            task_instance.set_failed(err_cls._name,  \n                                     msg,\n                                     json.dumps(traceback.format_exc()))\n        raise err_cls(msg)","commit_id":"ae6ce5a41b63ff252be42b25cf7a034ae1fa0bfc"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"f577847829d608a879ecabe3fa7a33be1ff17543","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _load_and_validate_task(self, task, task_args, task_args_file,"},{"line_number":134,"context_line":"                                deployment, task_instance\u003dNone):"},{"line_number":135,"context_line":"        try:"},{"line_number":136,"context_line":"            if not os.path.exists(task) or os.path.isdir(task):"},{"line_number":137,"context_line":"                error_msg \u003d \"No such file \u0027%s\u0027\" % task"},{"line_number":138,"context_line":"                raise IOError(error_msg)"},{"line_number":139,"context_line":"        except IOError as e:"},{"line_number":140,"context_line":"            if task_instance:"},{"line_number":141,"context_line":"                task_instance.set_failed(type(e).__name__,"},{"line_number":142,"context_line":"                                         str(e),"},{"line_number":143,"context_line":"                                         json.dumps(traceback.format_exc()))"},{"line_number":144,"context_line":"            raise e"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        input_task \u003d self._load_task(task, task_args, task_args_file)"},{"line_number":147,"context_line":"        api.Task.validate(deployment, input_task, task_instance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a061dce_6894ebe7","line":144,"range":{"start_line":135,"start_character":8,"end_line":144,"end_character":19},"updated":"2016-04-12 06:46:17.000000000","message":"It can be simplier, see my comment for old code","commit_id":"ce172da017bfe090477f65c6505926f50f4740ac"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"eca3c88be5e4ef18c58533c2efc88a16b68faa3f","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    def _load_and_validate_task(self, task, task_args, task_args_file,"},{"line_number":134,"context_line":"                                deployment, task_instance\u003dNone):"},{"line_number":135,"context_line":"        try:"},{"line_number":136,"context_line":"            if not os.path.exists(task) or os.path.isdir(task):"},{"line_number":137,"context_line":"                error_msg \u003d \"No such file \u0027%s\u0027\" % task"},{"line_number":138,"context_line":"                raise IOError(error_msg)"},{"line_number":139,"context_line":"        except IOError as e:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a1b2928_c155231e","line":136,"updated":"2016-04-11 12:24:58.000000000","message":"Better: if not os.path.isfile(task):","commit_id":"3f65061afe07e10876d20ef4ea77769a0c11141e"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"91cd1841fe6849ff6ce9829dd6e6a6a9aa55d284","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                print(_(\"\\nFor more details run:\\nrally -vd task detailed %s\")"},{"line_number":334,"context_line":"                      % task[\"uuid\"])"},{"line_number":335,"context_line":"            return 0"},{"line_number":336,"context_line":"        elif task[\"status\"] !\u003d consts.TaskStatus.FINISHED:"},{"line_number":337,"context_line":"            print(\"-\" * 80)"},{"line_number":338,"context_line":"            print(_(\"\\nThe task %s marked as \u0027%s\u0027. Results \""},{"line_number":339,"context_line":"                    \"available when it is \u0027%s\u0027.\") % ("},{"line_number":340,"context_line":"                task_id, task[\"status\"], consts.TaskStatus.FINISHED))"},{"line_number":341,"context_line":"            return 0"},{"line_number":342,"context_line":"        for result in task[\"results\"]:"},{"line_number":343,"context_line":"            key \u003d result[\"key\"]"},{"line_number":344,"context_line":"            print(\"-\" * 80)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a18252c_26d6b6c5","line":341,"range":{"start_line":336,"start_character":7,"end_line":341,"end_character":20},"updated":"2016-04-12 09:09:27.000000000","message":"it doesn\u0027t relate to this patch.","commit_id":"560d4634e499d0392b0e93eb22f35381a9a72b3b"},{"author":{"_account_id":20196,"name":"Piyush","email":"piyush2011257@gmail.com","username":"pirsriva"},"change_message_id":"bcc30141f8e7d2c004beb66ebbab664d2d53e742","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                print(_(\"\\nFor more details run:\\nrally -vd task detailed %s\")"},{"line_number":334,"context_line":"                      % task[\"uuid\"])"},{"line_number":335,"context_line":"            return 0"},{"line_number":336,"context_line":"        elif task[\"status\"] !\u003d consts.TaskStatus.FINISHED:"},{"line_number":337,"context_line":"            print(\"-\" * 80)"},{"line_number":338,"context_line":"            print(_(\"\\nThe task %s marked as \u0027%s\u0027. Results \""},{"line_number":339,"context_line":"                    \"available when it is \u0027%s\u0027.\") % ("},{"line_number":340,"context_line":"                task_id, task[\"status\"], consts.TaskStatus.FINISHED))"},{"line_number":341,"context_line":"            return 0"},{"line_number":342,"context_line":"        for result in task[\"results\"]:"},{"line_number":343,"context_line":"            key \u003d result[\"key\"]"},{"line_number":344,"context_line":"            print(\"-\" * 80)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a18252c_c91d5368","line":341,"range":{"start_line":336,"start_character":7,"end_line":341,"end_character":20},"in_reply_to":"5a18252c_26d6b6c5","updated":"2016-04-12 09:12:34.000000000","message":"It does. Kindly refer to bug description.\nCondition- For task whose status is INIT / VERIFYING and user tries \"rally task detailed \u003ctask-id\u003e\"","commit_id":"560d4634e499d0392b0e93eb22f35381a9a72b3b"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"0e1a789efb147c1066503699849a8757c32eef60","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                print(_(\"\\nFor more details run:\\nrally -vd task detailed %s\")"},{"line_number":334,"context_line":"                      % task[\"uuid\"])"},{"line_number":335,"context_line":"            return 0"},{"line_number":336,"context_line":"        elif task[\"status\"] !\u003d consts.TaskStatus.FINISHED:"},{"line_number":337,"context_line":"            print(\"-\" * 80)"},{"line_number":338,"context_line":"            print(_(\"\\nThe task %s marked as \u0027%s\u0027. Results \""},{"line_number":339,"context_line":"                    \"available when it is \u0027%s\u0027.\") % ("},{"line_number":340,"context_line":"                task_id, task[\"status\"], consts.TaskStatus.FINISHED))"},{"line_number":341,"context_line":"            return 0"},{"line_number":342,"context_line":"        for result in task[\"results\"]:"},{"line_number":343,"context_line":"            key \u003d result[\"key\"]"},{"line_number":344,"context_line":"            print(\"-\" * 80)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a18252c_0982ab52","line":341,"range":{"start_line":336,"start_character":7,"end_line":341,"end_character":20},"in_reply_to":"5a18252c_c91d5368","updated":"2016-04-12 09:16:25.000000000","message":"ok, but you should mention ABORTED status here too. It should have results too","commit_id":"560d4634e499d0392b0e93eb22f35381a9a72b3b"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"d3930fdb00062af6d5fe09c3e3187f6049787d6a","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            if task_instance:"},{"line_number":139,"context_line":"                task_instance.set_failed(err_cls.__name__,"},{"line_number":140,"context_line":"                                         msg,"},{"line_number":141,"context_line":"                                         json.dumps(traceback.format_exc()))"},{"line_number":142,"context_line":"            raise err_cls(msg)"},{"line_number":143,"context_line":"        input_task \u003d self._load_task(task, task_args, task_args_file)"},{"line_number":144,"context_line":"        api.Task.validate(deployment, input_task, task_instance)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a18252c_979c166b","line":141,"updated":"2016-04-12 10:00:09.000000000","message":"Nothing to format, there haven\u0027t been any exception raised yet!","commit_id":"99f3f1fa6287503021c20c487a8c159d31b09564"},{"author":{"_account_id":20196,"name":"Piyush","email":"piyush2011257@gmail.com","username":"pirsriva"},"change_message_id":"7bfa77e5cbf27e103f50aa55119202db14640014","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            if task_instance:"},{"line_number":139,"context_line":"                task_instance.set_failed(err_cls.__name__,"},{"line_number":140,"context_line":"                                         msg,"},{"line_number":141,"context_line":"                                         json.dumps(traceback.format_exc()))"},{"line_number":142,"context_line":"            raise err_cls(msg)"},{"line_number":143,"context_line":"        input_task \u003d self._load_task(task, task_args, task_args_file)"},{"line_number":144,"context_line":"        api.Task.validate(deployment, input_task, task_instance)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a18252c_5751de61","line":141,"in_reply_to":"5a18252c_979c166b","updated":"2016-04-12 10:05:08.000000000","message":"Ohh darn!! Yeah.\nTraceback will occur when an exception has been raised.\nI guess i will have to revert back to the earlier way of raising exception and logging traceback then.","commit_id":"99f3f1fa6287503021c20c487a8c159d31b09564"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"7874ba09ee743d820dff3e3cf7564c01fe855b8a","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _load_and_validate_task(self, task, task_args, task_args_file,"},{"line_number":134,"context_line":"                                deployment, task_instance\u003dNone):"},{"line_number":135,"context_line":"        try:"},{"line_number":136,"context_line":"            if not os.path.isfile(task):"},{"line_number":137,"context_line":"                error_msg \u003d \"No such file \u0027%s\u0027\" % task"},{"line_number":138,"context_line":"                raise IOError(error_msg)"},{"line_number":139,"context_line":"        except IOError as e:"},{"line_number":140,"context_line":"            if task_instance:"},{"line_number":141,"context_line":"                task_instance.set_failed(type(e).__name__,"},{"line_number":142,"context_line":"                                         str(e),"},{"line_number":143,"context_line":"                                         json.dumps(traceback.format_exc()))"},{"line_number":144,"context_line":"            raise e"},{"line_number":145,"context_line":"        input_task \u003d self._load_task(task, task_args, task_args_file)"},{"line_number":146,"context_line":"        api.Task.validate(deployment, input_task, task_instance)"},{"line_number":147,"context_line":"        print(_(\"Task config is valid :)\"))"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_8fcb5672","line":144,"range":{"start_line":135,"start_character":8,"end_line":144,"end_character":18},"updated":"2016-04-12 11:31:42.000000000","message":"I dislike re-raising exception. Alexander\u0027s comment can be fixed by replacing format_exc by format_stack","commit_id":"d538bd91bfdb48c4744caa89959a15d43beff32d"}],"tests/unit/cli/commands/test_task.py":[{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"bc38dc12a2d3bc025f3f076e51364bf4bc8e55f6","unresolved":false,"context_lines":[{"line_number":338,"context_line":"        verification \u003d yaml.safe_load(value[\"verification_log\"])"},{"line_number":339,"context_line":"        if debug:"},{"line_number":340,"context_line":"            mock_stdout.write.assert_has_calls(["},{"line_number":341,"context_line":"                mock.call(\"\\n\"), mock.call(\"-\" * 80), mock.call(\"\\n\"),"},{"line_number":342,"context_line":"                mock.call(\"Task test_task_id: failed\"),"},{"line_number":343,"context_line":"                mock.call(\"\\n\"), mock.call(\"-\" * 80), mock.call(\"\\n\"),"},{"line_number":344,"context_line":"                mock.call(\"%s\" % verification[2]),"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a18252c_cfeeeeeb","line":341,"updated":"2016-04-12 11:31:43.000000000","message":"These \"\\n\", \"-\" * 80 and other not critical messages are actually not important.\n\nTake a look at https://review.openstack.org/#/c/303511/4/tests/unit/cli/commands/test_task.py","commit_id":"d538bd91bfdb48c4744caa89959a15d43beff32d"}]}
