)]}'
{"trove/common/utils.py":[{"author":{"_account_id":9664,"name":"amrith","email":"amrith.kumar@gmail.com","username":"amrith"},"change_message_id":"0a150cdeddeaeb6505989a7b786ba53079a2d3b3","unresolved":false,"context_lines":[{"line_number":283,"context_line":"                _(\"Command \u0027%(cmd)s\u0027 failed. %(description)s \""},{"line_number":284,"context_line":"                  \"Exit code: %(exit_code)s\\nstderr: %(stderr)s\\n\""},{"line_number":285,"context_line":"                  \"stdout: %(stdout)s\") %"},{"line_number":286,"context_line":"                {\u0027cmd\u0027: e.cmd, \u0027description\u0027: e.description or \u0027\u0027,"},{"line_number":287,"context_line":"                 \u0027exit_code\u0027: e.exit_code, \u0027stderr\u0027: e.stderr,"},{"line_number":288,"context_line":"                 \u0027stdout\u0027: e.stdout})"},{"line_number":289,"context_line":"        raise"}],"source_content_type":"text/x-python","patch_set":5,"id":"7ac7a964_7b96f0f1","line":286,"updated":"2014-08-15 10:41:04.000000000","message":"since this code will likely go in before the matching change in oslo-incubator, please mask_password() on the command. mask_password is in openstack/common/strutils.py","commit_id":"330d1fb7bb26a5b00d17b9dd19b86adeea0a2947"}],"trove/guestagent/datastore/mysql/service.py":[{"author":{"_account_id":10215,"name":"Peter Stachowski","email":"peter@tesora.com","username":"peterstac"},"change_message_id":"cc5c7cce0c6fb64f89f94b86f1beb1c4bb4ce5dc","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            return rd_instance.ServiceStatuses.RUNNING"},{"line_number":164,"context_line":"        except exception.ProcessExecutionError as e:"},{"line_number":165,"context_line":"            LOG.error(\"Process execution failed with: %(stderr)s %(stdout)s\""},{"line_number":166,"context_line":"                      % {\u0027stderr\u0027: e.stderr, \u0027stdout\u0027: e.stdout})"},{"line_number":167,"context_line":"            try:"},{"line_number":168,"context_line":"                out, err \u003d utils.execute_with_timeout(\"/bin/ps\", \"-C\","},{"line_number":169,"context_line":"                                                      \"mysqld\", \"h\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_d66c189f","line":166,"updated":"2014-07-10 16:59:21.000000000","message":"I would prefer to see this in trove.common.utils.execute(), maybe controlled by a flag - that way other calls could benefit from it as well.  Since it only occurs on an error, maybe we eventually set the flag to true by default.\n\nSomething like:\n    def execute_with_timeout(*args, **kwargs):\n        time \u003d kwargs.pop(\u0027timeout\u0027, 30)\n        log_cmd_errors \u003d kwargs.pop(\u0027log_cmd_errors\u0027, False)\n    \n        timeout \u003d Timeout(time)\n        try:\n            return execute(*args, **kwargs)\n        except ProcessExecutionError as e:\n            if log_cmd_errors:\n                LOG.error(\"Command \u0027%(cmd)s\u0027 failed with stderr: %(stderr)s \"\n                          \"stdout: %(stdout)s\"\n                          % {\u0027cmd\u0027: e.cmd, \u0027stderr\u0027: e.stderr, \u0027stdout\u0027: e.stdout})\n            raise\n        except Timeout as t:\n            if t is not timeout:\n                LOG.error(_(\"Got a timeout but not the one expected.\"))\n                raise\n            else:\n                msg \u003d (_(\"Time out after waiting \"\n                         \"%(time)s seconds when running proc: %(args)s\"\n                         \" %(kwargs)s.\") % {\u0027time\u0027: time, \u0027args\u0027: args,\n                                            \u0027kwargs\u0027: kwargs})\n                LOG.error(msg)\n                raise exception.ProcessExecutionError(msg)\n        finally:\n            timeout.cancel()\n    \nThen you could call it with log_cmd_errors\u003dTrue","commit_id":"0828a6a4c100438d38ee3dc806b9697ef593962d"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"c386ff9f77b24de17c67b37da5600d71b122eeca","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            return rd_instance.ServiceStatuses.RUNNING"},{"line_number":164,"context_line":"        except exception.ProcessExecutionError as e:"},{"line_number":165,"context_line":"            LOG.error(\"Process execution failed with: %(stderr)s %(stdout)s\""},{"line_number":166,"context_line":"                      % {\u0027stderr\u0027: e.stderr, \u0027stdout\u0027: e.stdout})"},{"line_number":167,"context_line":"            try:"},{"line_number":168,"context_line":"                out, err \u003d utils.execute_with_timeout(\"/bin/ps\", \"-C\","},{"line_number":169,"context_line":"                                                      \"mysqld\", \"h\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_ba6006d0","line":166,"in_reply_to":"baada198_9328b234","updated":"2014-07-14 13:26:33.000000000","message":"You just have to log whole exception since it contains alot of useful data (more info you can find at [1]). Even more, if you would not do that you\u0027ll find message in log file that contains:\n- exit code\n- stdout\n- stderr\n- shell command\n- exception description.\n\n\n[1] https://github.com/openstack/trove/blob/master/trove/openstack/common/processutils.py#L49-L71","commit_id":"0828a6a4c100438d38ee3dc806b9697ef593962d"},{"author":{"_account_id":9664,"name":"amrith","email":"amrith.kumar@gmail.com","username":"amrith"},"change_message_id":"ea2c5464a83b85bb80cf8ff2cb6fb1f22646d428","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            return rd_instance.ServiceStatuses.RUNNING"},{"line_number":164,"context_line":"        except exception.ProcessExecutionError as e:"},{"line_number":165,"context_line":"            LOG.error(\"Process execution failed with: %(stderr)s %(stdout)s\""},{"line_number":166,"context_line":"                      % {\u0027stderr\u0027: e.stderr, \u0027stdout\u0027: e.stdout})"},{"line_number":167,"context_line":"            try:"},{"line_number":168,"context_line":"                out, err \u003d utils.execute_with_timeout(\"/bin/ps\", \"-C\","},{"line_number":169,"context_line":"                                                      \"mysqld\", \"h\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_9328b234","line":166,"in_reply_to":"baada198_d66c189f","updated":"2014-07-12 02:40:57.000000000","message":"I agree with Peter\u0027s observations here. The change proposed by the author is functional but could be more useful if implemented as a part of execute_with_timeout().\n\nAnd this code could utilize the functionality. \n\nA minor nit though; I\u0027d call the parameter log_output since it isn\u0027t just stderr that you are logging. But that\u0027s way deep in the weeds.","commit_id":"0828a6a4c100438d38ee3dc806b9697ef593962d"}],"trove/tests/unittests/common/test_utils.py":[{"author":{"_account_id":9664,"name":"amrith","email":"amrith.kumar@gmail.com","username":"amrith"},"change_message_id":"2d55840502973a2c088411304f81d1cb2ee9fc24","unresolved":false,"context_lines":[{"line_number":29,"context_line":"                description\u003d\u0027test-desc\u0027, exit_code\u003d42, stderr\u003d\u0027err\u0027,"},{"line_number":30,"context_line":"                stdout\u003d\u0027out\u0027, cmd\u003d\u0027test\u0027))"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        with ExpectedException("},{"line_number":33,"context_line":"                exception.ProcessExecutionError,"},{"line_number":34,"context_line":"                \"test-desc\\nCommand: test\\nExit code: 42\\n\""},{"line_number":35,"context_line":"                \"Stdout: \u0027out\u0027\\nStderr: \u0027err\u0027\"):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_2500f534","line":32,"updated":"2014-07-16 15:18:33.000000000","message":"I\u0027d add an assert on the message as well (without the extended information you just added)","commit_id":"6676f6e12590f27738f86d676e4d40ebc517651c"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"9b60928773015b859fe1105cb47a69fcefb6768e","unresolved":false,"context_lines":[{"line_number":29,"context_line":"                description\u003d\u0027test-desc\u0027, exit_code\u003d42, stderr\u003d\u0027err\u0027,"},{"line_number":30,"context_line":"                stdout\u003d\u0027out\u0027, cmd\u003d\u0027test\u0027))"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        with ExpectedException("},{"line_number":33,"context_line":"                exception.ProcessExecutionError,"},{"line_number":34,"context_line":"                \"test-desc\\nCommand: test\\nExit code: 42\\n\""},{"line_number":35,"context_line":"                \"Stdout: \u0027out\u0027\\nStderr: \u0027err\u0027\"):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_89c2bb84","line":32,"in_reply_to":"baada198_2500f534","updated":"2014-07-16 15:46:21.000000000","message":"Which message do you mean? The second argument to ExpectedException is tested against the raised exception\u0027s \u0027message\u0027 attribute.","commit_id":"6676f6e12590f27738f86d676e4d40ebc517651c"},{"author":{"_account_id":9664,"name":"amrith","email":"amrith.kumar@gmail.com","username":"amrith"},"change_message_id":"b167ec03abdb5b2fe6df5ed2228ad0146787a46a","unresolved":false,"context_lines":[{"line_number":29,"context_line":"                description\u003d\u0027test-desc\u0027, exit_code\u003d42, stderr\u003d\u0027err\u0027,"},{"line_number":30,"context_line":"                stdout\u003d\u0027out\u0027, cmd\u003d\u0027test\u0027))"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        with ExpectedException("},{"line_number":33,"context_line":"                exception.ProcessExecutionError,"},{"line_number":34,"context_line":"                \"test-desc\\nCommand: test\\nExit code: 42\\n\""},{"line_number":35,"context_line":"                \"Stdout: \u0027out\u0027\\nStderr: \u0027err\u0027\"):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_8ca1e997","line":32,"in_reply_to":"baada198_89c2bb84","updated":"2014-07-16 16:12:31.000000000","message":"Ionut, I had read the earlier code to mean that there would be a message (without this extended information) but that actually was something being logged by the caller. So you are correct, there would be nothing to look for her. Please ignore my comment (this one).","commit_id":"6676f6e12590f27738f86d676e4d40ebc517651c"}]}
