)]}'
{"swift/common/wsgi.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e409966e1edc10edee10956f43a18dd25db4cd15","unresolved":false,"context_lines":[{"line_number":880,"context_line":"    else:"},{"line_number":881,"context_line":"        strategy \u003d WorkersStrategy(conf, logger)"},{"line_number":882,"context_line":""},{"line_number":883,"context_line":"    error_msg \u003d None"},{"line_number":884,"context_line":"    try:"},{"line_number":885,"context_line":"        error_msg \u003d strategy.bind_ports()"},{"line_number":886,"context_line":"    except Exception as exp:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_b087b85f","line":883,"updated":"2016-04-21 08:32:58.000000000","message":"this assignment is not strictly necessary since error_msg is assigned in either the try or the except clause","commit_id":"ea1dcc878a8a58eff742459375db7b3dc5b5e9ad"}],"test/unit/common/test_wsgi.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e409966e1edc10edee10956f43a18dd25db4cd15","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    def tearDown(self):"},{"line_number":71,"context_line":"        mimetools.Message.parsetype \u003d self._orig_parsetype"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def test_run_wsgi_proxy_server(self):"},{"line_number":74,"context_line":"        conf_path \u003d \"/etc/swift/proxy-server.conf\""},{"line_number":75,"context_line":"        app_section \u003d \"proxy-server\""},{"line_number":76,"context_line":"        output \u003d wsgi.run_wsgi(conf_path, app_section, {\u0027verbose\u0027: False})"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_90027cb2","line":73,"updated":"2016-04-21 08:32:58.000000000","message":"these tests do not actually test the condition you are fixing i.e. an exception raised from bind_ports - if I revert your change the tests still pass.\n\nIf you watch the console output when the test runs you see that run_wsgi returns 1 because the conf file is not found - at least it does on a machine where the conf file is not in /etc/swift. On my test machine the conf file does exist and so the test actually attempts to start the server and bind to the port which may be in use, in which case run_wsgi eventually fails but only after some delay. But if the proxy port is not in use then the test will start a proxy server.\n\nYou need to mock bind_ports to raise an exception.","commit_id":"ea1dcc878a8a58eff742459375db7b3dc5b5e9ad"}]}
