)]}'
{"zun/api/controllers/v1/containers.py":[{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"7aa8290f712e4cc7a8703b354f5cea5d13afdc59","unresolved":false,"context_lines":[{"line_number":391,"context_line":"        compute_api \u003d pecan.request.compute_api"},{"line_number":392,"context_line":"        exec_output \u003d compute_api.container_exec(context, container,"},{"line_number":393,"context_line":"                                                 kw[\u0027command\u0027])"},{"line_number":394,"context_line":"        if \"executable file not found\" in exec_output:"},{"line_number":395,"context_line":"            pecan.response.status \u003d 400"},{"line_number":396,"context_line":"        return exec_output"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    @pecan.expose(\u0027json\u0027)"},{"line_number":399,"context_line":"    @exception.wrap_pecan_controller_exception"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a430d35_0d402856","line":396,"range":{"start_line":394,"start_character":0,"end_line":396,"end_character":26},"updated":"2017-02-03 07:14:43.000000000","message":"This is too much hacking.\n\ncan you please try to figure out why this error is not raised in compute layer?\n\nwe\u0027v already have this decorator.\n\nhttps://github.com/openstack/zun/blob/master/zun/common/utils.py#L131\n\n\nSince in compute layer, zun compute is a client to docker daemon, and it will get a http response, we\u0027d better handle all exception there, and all exception handle process in REST API layer should be align together.","commit_id":"3d8351faae675b8b76950563e7a59b29f3cf1a42"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"966d947566be8228fd9d35db123b1d092acfae6a","unresolved":false,"context_lines":[{"line_number":391,"context_line":"        compute_api \u003d pecan.request.compute_api"},{"line_number":392,"context_line":"        exec_output \u003d compute_api.container_exec(context, container,"},{"line_number":393,"context_line":"                                                 kw[\u0027command\u0027])"},{"line_number":394,"context_line":"        if \"executable file not found\" in exec_output:"},{"line_number":395,"context_line":"            pecan.response.status \u003d 400"},{"line_number":396,"context_line":"        return exec_output"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    @pecan.expose(\u0027json\u0027)"},{"line_number":399,"context_line":"    @exception.wrap_pecan_controller_exception"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_f2be4ad3","line":396,"range":{"start_line":394,"start_character":0,"end_line":396,"end_character":26},"in_reply_to":"1a430d35_0248895a","updated":"2017-02-10 08:24:01.000000000","message":"+1 agree with Hongbin and Eli.\nAPI layer is not the right place to do such processing.","commit_id":"3d8351faae675b8b76950563e7a59b29f3cf1a42"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"5f1d06074af6a00b0b481a1bdce828c559bf5f8e","unresolved":false,"context_lines":[{"line_number":391,"context_line":"        compute_api \u003d pecan.request.compute_api"},{"line_number":392,"context_line":"        exec_output \u003d compute_api.container_exec(context, container,"},{"line_number":393,"context_line":"                                                 kw[\u0027command\u0027])"},{"line_number":394,"context_line":"        if \"executable file not found\" in exec_output:"},{"line_number":395,"context_line":"            pecan.response.status \u003d 400"},{"line_number":396,"context_line":"        return exec_output"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    @pecan.expose(\u0027json\u0027)"},{"line_number":399,"context_line":"    @exception.wrap_pecan_controller_exception"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a430d35_0248895a","line":396,"range":{"start_line":394,"start_character":0,"end_line":396,"end_character":26},"in_reply_to":"1a430d35_0d402856","updated":"2017-02-06 23:00:22.000000000","message":"I agreed with @Eli. A better way of doing this is to use the \"Exec Inspect\" API [1]. It will return a json response that contains \"ExitCode\". You can throw an exception based on the exitcode.\n\n[1] https://docs.docker.com/engine/api/v1.24/","commit_id":"3d8351faae675b8b76950563e7a59b29f3cf1a42"}],"zun/container/docker/driver.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"484172514fd944fb518845cf96b83e4e5d3cc81b","unresolved":false,"context_lines":[{"line_number":261,"context_line":"            exec_output \u003d docker.exec_start(create_res, False, False, False)"},{"line_number":262,"context_line":"            response \u003d docker.exec_inspect(create_res)"},{"line_number":263,"context_line":"            if response[\u0027ExitCode\u0027] !\u003d 0:"},{"line_number":264,"context_line":"                raise exception.Invalid()"},{"line_number":265,"context_line":"            return exec_output"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    @check_container_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"da36d5c6_64d603c7","line":264,"range":{"start_line":264,"start_character":32,"end_line":264,"end_character":39},"updated":"2017-02-20 16:19:54.000000000","message":"@Feng,\n\nThis change works very well. I might be a bit picky here. It would be better to populate a detailed error message into the exception (the default error message doesn\u0027t explain anything). It could be something like (untested):\n\n  _(\"Command didn\u0027t get executed successfully. Output: %s\"),  exec_output)","commit_id":"116153c6eb12a2d5ab94a6b5cc060a361b2e6bd2"},{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"960f59304e2add763001b00a5c6acc0fe6139184","unresolved":false,"context_lines":[{"line_number":260,"context_line":"                container.container_id, command, True, True, False)"},{"line_number":261,"context_line":"            exec_output \u003d docker.exec_start(create_res, False, False, False)"},{"line_number":262,"context_line":"            response \u003d docker.exec_inspect(create_res)"},{"line_number":263,"context_line":"            if response[\u0027ExitCode\u0027] !\u003d 0:"},{"line_number":264,"context_line":"                msg \u003d _(\"The command cann\u0027t be executed successfully.\""},{"line_number":265,"context_line":"                        \"Output: %s.\") % exec_output"},{"line_number":266,"context_line":"                raise exception.Invalid(message\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_01f283d2","line":263,"range":{"start_line":263,"start_character":12,"end_line":263,"end_character":41},"updated":"2017-02-21 07:58:28.000000000","message":"Sorry @feng, I looked the code very late.  I was thinking if non zero exit code really means failure. Its a recommendation in unix based system to write programs which return non-zero on failures, but its not mandatory. Any programmers can write the code which returns different non-zero exit codes for different purpose. For example grep returns 1 when it does not find the match and i don\u0027t think that is a failure. So i think it would be better to leave it as it is. This is my personal view and i am putting my -1, so that other don\u0027t merge it without proper discussion. What do you think?","commit_id":"364a57108821aadbe98636034598a41b9e53236c"}]}
