)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"e0188b179cd7609fedbb0309ca5fc2df19aa35af","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"e72d2915_af07cbdc","updated":"2025-03-26 09:23:10.000000000","message":"Great to see your first contribution :)\n\nLooks pretty good to me and works as expected. Please see my inline comments for some additional testing ideas.","commit_id":"4a3b7d1847403a945fbfe806e08af148747fa68a"},{"author":{"_account_id":37819,"name":"Pawel Tetera","email":"ptetera@redhat.com","username":"ptetera"},"change_message_id":"7811abfbb6f6806de1029c9e89acef981c5da31b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"4a3c0a66_4d35161f","updated":"2025-03-26 17:39:11.000000000","message":"Good idea, thanks I added the tests. I\u0027ve already considered played around with adding them before before however I hit some strange behaviour with mutability.\n\nOriginally tried\n`self.assertFalse(swiftclient.client.logger_settings.get(\u0027redact_sensitive_headers\u0027))`\n(notice the `.client`) for the `--debug-with-secrets` argv part in `test_shell.py`\nand the isolated `tox run -- test.unit.test_shell.TestDebugAndInfoOptions` test would pass but `./run_tests.sh` would fail\n\n`swiftclient.logger_settings.get()` however does work as expected so I went ahead with that.\n\nI\u0027m curious why when `.client` is used the assert is true before the execution and false afterwards if anyone has any insights on that.","commit_id":"407c35c467112a198d8f8fd5b556ab7f78397395"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"1fda089dfc5e0fc2381d4d0781ac185b30c0d402","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"de874fa1_aaff12a8","in_reply_to":"0a3c261d_3fb1afc4","updated":"2025-03-27 13:35:28.000000000","message":"I think that\u0027s the case. When running only a subset of tests, patchset #3 passes successfully. I noticed that the two variables are no longer the same object if all test classes are executed (checked using assertIs()).","commit_id":"407c35c467112a198d8f8fd5b556ab7f78397395"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"9bc42bbc68749e679b3de155004f99dadf67b087","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"0a3c261d_3fb1afc4","in_reply_to":"4a3c0a66_4d35161f","updated":"2025-03-26 19:48:01.000000000","message":"\u003e Originally tried\n`self.assertFalse(swiftclient.client.logger_settings.get(\u0027redact_sensitive_headers\u0027))`\n(notice the `.client`) for the `--debug-with-secrets` argv part in `test_shell.py`\nand the isolated `tox run -- test.unit.test_shell.TestDebugAndInfoOptions` test would pass but `./run_tests.sh` would fail\n\nMaybe there\u0027s some unintentional test coupling -- some other test leaves the global state `True`, say?","commit_id":"407c35c467112a198d8f8fd5b556ab7f78397395"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"1fda089dfc5e0fc2381d4d0781ac185b30c0d402","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"d935071f_318008b2","updated":"2025-03-27 13:35:28.000000000","message":"LGTM, WFM.","commit_id":"9e67409f33d708f2beafb21cafeff30e9a7ff637"}],"swiftclient/shell.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"9bc42bbc68749e679b3de155004f99dadf67b087","unresolved":true,"context_lines":[{"line_number":1646,"context_line":"            logging.basicConfig(level\u003dlogging.DEBUG)"},{"line_number":1647,"context_line":"            logging.getLogger(\u0027iso8601\u0027).setLevel(logging.WARNING)"},{"line_number":1648,"context_line":"            if options.get(\u0027debug_with_secrets\u0027):"},{"line_number":1649,"context_line":"                client_logger_settings[\u0027redact_sensitive_headers\u0027] \u003d False"},{"line_number":1650,"context_line":"        elif options.get(\u0027info\u0027):"},{"line_number":1651,"context_line":"            logging.basicConfig(level\u003dlogging.INFO)"},{"line_number":1652,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"199e11d7_0070b14e","line":1649,"updated":"2025-03-26 19:48:01.000000000","message":"I wonder if we should maybe *always* set this (True or False) as part of `parse_args`, like\n```\ndiff --git a/swiftclient/shell.py b/swiftclient/shell.py\nindex cfc13f6..23691f2 100755\n--- a/swiftclient/shell.py\n+++ b/swiftclient/shell.py\n@@ -1645,10 +1645,10 @@ def parse_args(parser, args, enforce_requires\u003dTrue):\n         if options.get(\u0027debug\u0027) or options.get(\u0027debug_with_secrets\u0027):\n             logging.basicConfig(level\u003dlogging.DEBUG)\n             logging.getLogger(\u0027iso8601\u0027).setLevel(logging.WARNING)\n-            if options.get(\u0027debug_with_secrets\u0027):\n-                client_logger_settings[\u0027redact_sensitive_headers\u0027] \u003d False\n         elif options.get(\u0027info\u0027):\n             logging.basicConfig(level\u003dlogging.INFO)\n+    client_logger_settings[\u0027redact_sensitive_headers\u0027] \u003d not (\n+        enforce_requires and options.get(\u0027debug_with_secrets\u0027))\n \n     if args and options.get(\u0027help\u0027):\n         _help \u003d globals().get(\u0027st_%s_help\u0027 % args[0])\n```\nEven with that, though, I see differences between `stestr` or `pytest` as test runner if I make assertions on `swiftclient.client.logger_settings`. Using `swiftclient.shell.client_logger_settings` or `swiftclient.logger_settings` both work though -- strange.","commit_id":"407c35c467112a198d8f8fd5b556ab7f78397395"},{"author":{"_account_id":37819,"name":"Pawel Tetera","email":"ptetera@redhat.com","username":"ptetera"},"change_message_id":"cda7547e99f808cf284db59daa04916ffb84c825","unresolved":false,"context_lines":[{"line_number":1646,"context_line":"            logging.basicConfig(level\u003dlogging.DEBUG)"},{"line_number":1647,"context_line":"            logging.getLogger(\u0027iso8601\u0027).setLevel(logging.WARNING)"},{"line_number":1648,"context_line":"            if options.get(\u0027debug_with_secrets\u0027):"},{"line_number":1649,"context_line":"                client_logger_settings[\u0027redact_sensitive_headers\u0027] \u003d False"},{"line_number":1650,"context_line":"        elif options.get(\u0027info\u0027):"},{"line_number":1651,"context_line":"            logging.basicConfig(level\u003dlogging.INFO)"},{"line_number":1652,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"e5767366_82a0247d","line":1649,"in_reply_to":"199e11d7_0070b14e","updated":"2025-03-27 10:15:14.000000000","message":"Tox tests seem to pass on py311 with this (always setting True/False) so I went with that to move the patch forward, thanks!","commit_id":"407c35c467112a198d8f8fd5b556ab7f78397395"}],"test/unit/test_shell.py":[{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"e0188b179cd7609fedbb0309ca5fc2df19aa35af","unresolved":true,"context_lines":[{"line_number":2650,"context_line":""},{"line_number":2651,"context_line":"        argv \u003d [\"\", \"stat\", \"--debug\"]"},{"line_number":2652,"context_line":"        swiftclient.shell.main(argv)"},{"line_number":2653,"context_line":"        mock_logging.assert_called_with(level\u003dlogging.DEBUG)"},{"line_number":2654,"context_line":""},{"line_number":2655,"context_line":"        argv \u003d [\"\", \"stat\", \"--debug-with-secrets\"]"},{"line_number":2656,"context_line":"        swiftclient.shell.main(argv)"}],"source_content_type":"text/x-python","patch_set":2,"id":"30e71ad2_36cc12ff","line":2653,"updated":"2025-03-26 09:23:10.000000000","message":"I think it would be good to verify that logger_settings[\u0027redact_sensitive_headers\u0027] is set to True now. This could help to prevent future regressions as well.","commit_id":"4a3b7d1847403a945fbfe806e08af148747fa68a"},{"author":{"_account_id":37819,"name":"Pawel Tetera","email":"ptetera@redhat.com","username":"ptetera"},"change_message_id":"7811abfbb6f6806de1029c9e89acef981c5da31b","unresolved":false,"context_lines":[{"line_number":2650,"context_line":""},{"line_number":2651,"context_line":"        argv \u003d [\"\", \"stat\", \"--debug\"]"},{"line_number":2652,"context_line":"        swiftclient.shell.main(argv)"},{"line_number":2653,"context_line":"        mock_logging.assert_called_with(level\u003dlogging.DEBUG)"},{"line_number":2654,"context_line":""},{"line_number":2655,"context_line":"        argv \u003d [\"\", \"stat\", \"--debug-with-secrets\"]"},{"line_number":2656,"context_line":"        swiftclient.shell.main(argv)"}],"source_content_type":"text/x-python","patch_set":2,"id":"31459244_6dfc3083","line":2653,"in_reply_to":"30e71ad2_36cc12ff","updated":"2025-03-26 17:39:11.000000000","message":"Done","commit_id":"4a3b7d1847403a945fbfe806e08af148747fa68a"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"e0188b179cd7609fedbb0309ca5fc2df19aa35af","unresolved":true,"context_lines":[{"line_number":2654,"context_line":""},{"line_number":2655,"context_line":"        argv \u003d [\"\", \"stat\", \"--debug-with-secrets\"]"},{"line_number":2656,"context_line":"        swiftclient.shell.main(argv)"},{"line_number":2657,"context_line":"        mock_logging.assert_called_with(level\u003dlogging.DEBUG)"},{"line_number":2658,"context_line":""},{"line_number":2659,"context_line":"    @mock.patch(\u0027logging.basicConfig\u0027)"},{"line_number":2660,"context_line":"    @mock.patch(\u0027swiftclient.service.Connection\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"2e589961_f3760ffe","line":2657,"updated":"2025-03-26 09:23:10.000000000","message":"Same as above, but now to ensure redact_sensitive_headers is set to False","commit_id":"4a3b7d1847403a945fbfe806e08af148747fa68a"},{"author":{"_account_id":37819,"name":"Pawel Tetera","email":"ptetera@redhat.com","username":"ptetera"},"change_message_id":"7811abfbb6f6806de1029c9e89acef981c5da31b","unresolved":false,"context_lines":[{"line_number":2654,"context_line":""},{"line_number":2655,"context_line":"        argv \u003d [\"\", \"stat\", \"--debug-with-secrets\"]"},{"line_number":2656,"context_line":"        swiftclient.shell.main(argv)"},{"line_number":2657,"context_line":"        mock_logging.assert_called_with(level\u003dlogging.DEBUG)"},{"line_number":2658,"context_line":""},{"line_number":2659,"context_line":"    @mock.patch(\u0027logging.basicConfig\u0027)"},{"line_number":2660,"context_line":"    @mock.patch(\u0027swiftclient.service.Connection\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"41e7e552_19f9e4ea","line":2657,"in_reply_to":"2e589961_f3760ffe","updated":"2025-03-26 17:39:11.000000000","message":"Done","commit_id":"4a3b7d1847403a945fbfe806e08af148747fa68a"}]}
