)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fadde982fcb2cf5348c58749b1f1876ef112c27f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7fb9b21a_fcc7dbe5","updated":"2024-08-07 14:39:59.000000000","message":"Just need to fix the py2 test failure, see comment inline.\n\nThis seems to move everything relevant to logs to test_logs.py.\n\nwith this change nothing in this list of imports is referenced in ``test_utils.py``:\n\n```\nfrom swift.common.utils.logs import (   # noqa\n    SysLogHandler,  # t.u.helpers.setup_servers monkey patch is sketch\n    logging_monkey_patch,\n    get_logger,\n    PrefixLoggerAdapter,\n    LogLevelFilter,\n    NullLogger,\n    capture_stdio,\n    SwiftLogFormatter,\n    SwiftLoggerAdapter,\n    LogAdapter,\n    LoggerFileObject,\n    PipeMutex,\n    NoopMutex,\n    ThreadSafeSysLogHandler,\n    StrAnonymizer,\n    get_log_line,\n    StrFormatTime,\n    LogStringFormatter,\n    get_policy_index,\n    LOG_LINE_DEFAULT_FORMAT,\n    NOTICE,\n)\n```","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"ceb3e0f82d03371ab3176aaffd47bcfa1c5bb161","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"10e2fd4f_86e2847b","updated":"2024-08-08 17:47:33.000000000","message":"recheck","commit_id":"24b84288598c95eb85a434568a5170087dc3040e"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"e5316531cc7fb2e74684a71774a5b101357f804e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"7bfdd1ec_15208405","updated":"2024-08-08 20:09:33.000000000","message":"recheck","commit_id":"f5a8851dae98bc51c052c71bc6c6465eb008df38"}],"test/unit/common/utils/test_logs.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fadde982fcb2cf5348c58749b1f1876ef112c27f","unresolved":true,"context_lines":[{"line_number":42,"context_line":"else:"},{"line_number":43,"context_line":"    import eventlet.green.http.client as green_http_client"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"from swift.common import utils"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"from swift.common.swob import Request, Response"},{"line_number":48,"context_line":"from swift.common.utils.logs import SwiftLogFormatter"}],"source_content_type":"text/x-python","patch_set":1,"id":"00d81fc5_c0822024","line":45,"updated":"2024-08-07 14:39:59.000000000","message":"we might want to change this to import from utils.logs - but not in this because that will dirty the moved lines. As it is, this patch is really easy to compare just moved code.","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"619e8c8f6ba143867fe40dba79686fa2246bac2d","unresolved":true,"context_lines":[{"line_number":42,"context_line":"else:"},{"line_number":43,"context_line":"    import eventlet.green.http.client as green_http_client"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"from swift.common import utils"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"from swift.common.swob import Request, Response"},{"line_number":48,"context_line":"from swift.common.utils.logs import SwiftLogFormatter"}],"source_content_type":"text/x-python","patch_set":1,"id":"7c1f72d5_b132d204","line":45,"in_reply_to":"00d81fc5_c0822024","updated":"2024-08-08 16:35:41.000000000","message":"We have had backwards compatibility with all the recently moved code. \nFor example, all files importing utils still imports utils and not utils.logs or utils,config. To keep that consistent, from swift.common import utils.","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"b21e4682406daba2369b4426fabd5a8ec67bf0ee","unresolved":false,"context_lines":[{"line_number":42,"context_line":"else:"},{"line_number":43,"context_line":"    import eventlet.green.http.client as green_http_client"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"from swift.common import utils"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"from swift.common.swob import Request, Response"},{"line_number":48,"context_line":"from swift.common.utils.logs import SwiftLogFormatter"}],"source_content_type":"text/x-python","patch_set":1,"id":"67e08250_aa1e1411","line":45,"in_reply_to":"7c1f72d5_b132d204","updated":"2024-08-08 19:36:55.000000000","message":"Done","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fadde982fcb2cf5348c58749b1f1876ef112c27f","unresolved":true,"context_lines":[{"line_number":93,"context_line":"        logger.addHandler(handler)"},{"line_number":94,"context_line":"        lfo_stdout \u003d utils.LoggerFileObject(logger)"},{"line_number":95,"context_line":"        lfo_stderr \u003d utils.LoggerFileObject(logger, \u0027STDERR\u0027)"},{"line_number":96,"context_line":"        print(\u0027test1\u0027)"},{"line_number":97,"context_line":"        self.assertEqual(sio.getvalue(), \u0027\u0027)"},{"line_number":98,"context_line":"        sys.stdout \u003d lfo_stdout"},{"line_number":99,"context_line":"        print(\u0027test2\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"55860653_d7e393bd","line":96,"updated":"2024-08-07 14:39:59.000000000","message":"py2 tests fail because ``print()`` (i.e. a function with parentheses) didn\u0027t exist in py2. You need to mimic test_utils import:\n\n```\ndiff --git a/test/unit/common/utils/test_logs.py b/test/unit/common/utils/test_logs.py\nindex 1e9be8a89..48f844d0e 100644\n--- a/test/unit/common/utils/test_logs.py\n+++ b/test/unit/common/utils/test_logs.py\n@@ -14,6 +14,8 @@\n # limitations under the License.\n\n \"\"\"Tests for swift.common.utils.logs\"\"\"\n+from __future__ import print_function\n+\n import contextlib\n import errno\n import hashlib```","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"619e8c8f6ba143867fe40dba79686fa2246bac2d","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        logger.addHandler(handler)"},{"line_number":94,"context_line":"        lfo_stdout \u003d utils.LoggerFileObject(logger)"},{"line_number":95,"context_line":"        lfo_stderr \u003d utils.LoggerFileObject(logger, \u0027STDERR\u0027)"},{"line_number":96,"context_line":"        print(\u0027test1\u0027)"},{"line_number":97,"context_line":"        self.assertEqual(sio.getvalue(), \u0027\u0027)"},{"line_number":98,"context_line":"        sys.stdout \u003d lfo_stdout"},{"line_number":99,"context_line":"        print(\u0027test2\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"05a3d81c_a692240b","line":96,"in_reply_to":"55860653_d7e393bd","updated":"2024-08-08 16:35:41.000000000","message":"Acknowledged","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fadde982fcb2cf5348c58749b1f1876ef112c27f","unresolved":true,"context_lines":[{"line_number":187,"context_line":"                logger.info(\"I like ham\")"},{"line_number":188,"context_line":"                self.assertGreater(crashy_calls[0], 1)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        logger.removeHandler(handler)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    def test_get_logger(self):"},{"line_number":193,"context_line":"        sio \u003d StringIO()"}],"source_content_type":"text/x-python","patch_set":1,"id":"d594270e_7a718f38","line":190,"updated":"2024-08-07 14:39:59.000000000","message":"ok to here, faithful copy from test_utils.py","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"619e8c8f6ba143867fe40dba79686fa2246bac2d","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                logger.info(\"I like ham\")"},{"line_number":188,"context_line":"                self.assertGreater(crashy_calls[0], 1)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        logger.removeHandler(handler)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    def test_get_logger(self):"},{"line_number":193,"context_line":"        sio \u003d StringIO()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5c4ffcba_ca40d929","line":190,"in_reply_to":"d594270e_7a718f38","updated":"2024-08-08 16:35:41.000000000","message":"Done","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fadde982fcb2cf5348c58749b1f1876ef112c27f","unresolved":true,"context_lines":[{"line_number":770,"context_line":"            self.assertEqual(strip_value(sio), \u0027one: two: test\\n\u0027)"},{"line_number":771,"context_line":"            self.assertEqual(strip_value(sio), \u0027\u0027)"},{"line_number":772,"context_line":"        finally:"},{"line_number":773,"context_line":"            base_logger.logger.removeHandler(handler)"},{"line_number":774,"context_line":""},{"line_number":775,"context_line":"    @reset_logger_state"},{"line_number":776,"context_line":"    def test_capture_stdio(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"b152b1c7_a5467808","line":773,"updated":"2024-08-07 14:39:59.000000000","message":"ok to here","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"619e8c8f6ba143867fe40dba79686fa2246bac2d","unresolved":false,"context_lines":[{"line_number":770,"context_line":"            self.assertEqual(strip_value(sio), \u0027one: two: test\\n\u0027)"},{"line_number":771,"context_line":"            self.assertEqual(strip_value(sio), \u0027\u0027)"},{"line_number":772,"context_line":"        finally:"},{"line_number":773,"context_line":"            base_logger.logger.removeHandler(handler)"},{"line_number":774,"context_line":""},{"line_number":775,"context_line":"    @reset_logger_state"},{"line_number":776,"context_line":"    def test_capture_stdio(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5072433c_67473a4d","line":773,"in_reply_to":"b152b1c7_a5467808","updated":"2024-08-08 16:35:41.000000000","message":"Done","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fadde982fcb2cf5348c58749b1f1876ef112c27f","unresolved":true,"context_lines":[{"line_number":845,"context_line":"                            isinstance(h, logging.StreamHandler)]"},{"line_number":846,"context_line":"        self.assertEqual(len(console_handlers), 1)"},{"line_number":847,"context_line":"        new_handler \u003d console_handlers[0]"},{"line_number":848,"context_line":"        self.assertNotEqual(new_handler, old_handler)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"    def test_get_policy_index(self):"},{"line_number":851,"context_line":"        # Account has no information about a policy"}],"source_content_type":"text/x-python","patch_set":1,"id":"01ca01c1_0b760937","line":848,"updated":"2024-08-07 14:39:59.000000000","message":"ok to here","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"619e8c8f6ba143867fe40dba79686fa2246bac2d","unresolved":false,"context_lines":[{"line_number":845,"context_line":"                            isinstance(h, logging.StreamHandler)]"},{"line_number":846,"context_line":"        self.assertEqual(len(console_handlers), 1)"},{"line_number":847,"context_line":"        new_handler \u003d console_handlers[0]"},{"line_number":848,"context_line":"        self.assertNotEqual(new_handler, old_handler)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"    def test_get_policy_index(self):"},{"line_number":851,"context_line":"        # Account has no information about a policy"}],"source_content_type":"text/x-python","patch_set":1,"id":"6d223447_a5366fdb","line":848,"in_reply_to":"01ca01c1_0b760937","updated":"2024-08-08 16:35:41.000000000","message":"Done","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fadde982fcb2cf5348c58749b1f1876ef112c27f","unresolved":true,"context_lines":[{"line_number":997,"context_line":"                    exp_line,"},{"line_number":998,"context_line":"                    utils.get_log_line(req, res, trans_time, additional_info,"},{"line_number":999,"context_line":"                                       utils.LOG_LINE_DEFAULT_FORMAT,"},{"line_number":1000,"context_line":"                                       \u0027md5\u0027, \u002754LT\u0027))"},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":""},{"line_number":1003,"context_line":"class TestSwiftLoggerAdapter(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3ba08395_1a5fb107","line":1000,"updated":"2024-08-07 14:39:59.000000000","message":"ok to here","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"619e8c8f6ba143867fe40dba79686fa2246bac2d","unresolved":false,"context_lines":[{"line_number":997,"context_line":"                    exp_line,"},{"line_number":998,"context_line":"                    utils.get_log_line(req, res, trans_time, additional_info,"},{"line_number":999,"context_line":"                                       utils.LOG_LINE_DEFAULT_FORMAT,"},{"line_number":1000,"context_line":"                                       \u0027md5\u0027, \u002754LT\u0027))"},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":""},{"line_number":1003,"context_line":"class TestSwiftLoggerAdapter(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"546979ed_3df5c88f","line":1000,"in_reply_to":"3ba08395_1a5fb107","updated":"2024-08-08 16:35:41.000000000","message":"Done","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fadde982fcb2cf5348c58749b1f1876ef112c27f","unresolved":true,"context_lines":[{"line_number":1045,"context_line":"        except OSError:"},{"line_number":1046,"context_line":"            with mock.patch(\u0027logging.LoggerAdapter.error\u0027) as mocked:"},{"line_number":1047,"context_line":"                adapter.exception(\u0027Caught\u0027)"},{"line_number":1048,"context_line":"        mocked.assert_called_with(\u0027Caught: Connection refused\u0027)"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":""},{"line_number":1051,"context_line":"class TestPipeMutex(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7283a79e_23793ae3","line":1048,"updated":"2024-08-07 14:39:59.000000000","message":"ok all good","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"619e8c8f6ba143867fe40dba79686fa2246bac2d","unresolved":false,"context_lines":[{"line_number":1045,"context_line":"        except OSError:"},{"line_number":1046,"context_line":"            with mock.patch(\u0027logging.LoggerAdapter.error\u0027) as mocked:"},{"line_number":1047,"context_line":"                adapter.exception(\u0027Caught\u0027)"},{"line_number":1048,"context_line":"        mocked.assert_called_with(\u0027Caught: Connection refused\u0027)"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":""},{"line_number":1051,"context_line":"class TestPipeMutex(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f733511_b08fbcc4","line":1048,"in_reply_to":"7283a79e_23793ae3","updated":"2024-08-08 16:35:41.000000000","message":"Done","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"fadde982fcb2cf5348c58749b1f1876ef112c27f","unresolved":true,"context_lines":[{"line_number":1246,"context_line":"            return self.mutex.acquire(blocking\u003dFalse)"},{"line_number":1247,"context_line":""},{"line_number":1248,"context_line":"        with self.mutex as ref:"},{"line_number":1249,"context_line":"            self.assertIs(ref, self.mutex)"}],"source_content_type":"text/x-python","patch_set":1,"id":"4a380f71_b58a7493","line":1249,"updated":"2024-08-07 14:39:59.000000000","message":"ok!","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"619e8c8f6ba143867fe40dba79686fa2246bac2d","unresolved":false,"context_lines":[{"line_number":1246,"context_line":"            return self.mutex.acquire(blocking\u003dFalse)"},{"line_number":1247,"context_line":""},{"line_number":1248,"context_line":"        with self.mutex as ref:"},{"line_number":1249,"context_line":"            self.assertIs(ref, self.mutex)"}],"source_content_type":"text/x-python","patch_set":1,"id":"d75bc1f0_bdcdd4b4","line":1249,"in_reply_to":"4a380f71_b58a7493","updated":"2024-08-08 16:35:41.000000000","message":"Done","commit_id":"b17ad580bdda4aa82996612f35c00e4385873ea6"}],"tox.ini":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e283f5890b9380e705c66fd4e16940fa309bdb31","unresolved":true,"context_lines":[{"line_number":1,"context_line":"[tox]"},{"line_number":2,"context_line":"envlist \u003d py37,py27,pep8"},{"line_number":3,"context_line":"toxworkdir \u003d /home/vagrant/.tox-swift"},{"line_number":4,"context_line":"minversion \u003d 3.18.0"},{"line_number":5,"context_line":"requires \u003d"},{"line_number":6,"context_line":"  # required to support py27/py36 envs"}],"source_content_type":"text/x-properties","patch_set":2,"id":"40814316_c09f858c","line":3,"updated":"2024-08-08 18:03:51.000000000","message":"I think this has leaked in from a vsaio environment and its making zuul CI very unhappy ;-)","commit_id":"24b84288598c95eb85a434568a5170087dc3040e"},{"author":{"_account_id":35790,"name":"Shreeya Deshpande","email":"shreeyad@nvidia.com","username":"shreeyad"},"change_message_id":"b21e4682406daba2369b4426fabd5a8ec67bf0ee","unresolved":false,"context_lines":[{"line_number":1,"context_line":"[tox]"},{"line_number":2,"context_line":"envlist \u003d py37,py27,pep8"},{"line_number":3,"context_line":"toxworkdir \u003d /home/vagrant/.tox-swift"},{"line_number":4,"context_line":"minversion \u003d 3.18.0"},{"line_number":5,"context_line":"requires \u003d"},{"line_number":6,"context_line":"  # required to support py27/py36 envs"}],"source_content_type":"text/x-properties","patch_set":2,"id":"8887fcee_bf7d8de6","line":3,"in_reply_to":"40814316_c09f858c","updated":"2024-08-08 19:36:55.000000000","message":"Acknowledged","commit_id":"24b84288598c95eb85a434568a5170087dc3040e"}]}
