)]}'
{"swiftclient/service.py":[{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"d7a9e98236005738b2a313497c8f064bd1aac153","unresolved":false,"context_lines":[{"line_number":1446,"context_line":"                                \u0027skip_identical\u0027: False,"},{"line_number":1447,"context_line":"                                \u0027fail_fast\u0027: False,"},{"line_number":1448,"context_line":"                                \u0027dir_marker\u0027: False  # Only for None sources"},{"line_number":1449,"context_line":"                            }"},{"line_number":1450,"context_line":""},{"line_number":1451,"context_line":"        :returns: A generator for returning the results of the uploads."},{"line_number":1452,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_2dff0e01","line":1449,"range":{"start_line":1449,"start_character":28,"end_line":1449,"end_character":29},"updated":"2019-12-04 06:36:59.000000000","message":"does it make sense to add version-id to service, but not shell?","commit_id":"8ed8d678f7439264642ecaaf09359e460d215d1f"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"d7a9e98236005738b2a313497c8f064bd1aac153","unresolved":false,"context_lines":[{"line_number":2386,"context_line":"                            {"},{"line_number":2387,"context_line":"                                \u0027yes_all\u0027: False,"},{"line_number":2388,"context_line":"                                \u0027leave_segments\u0027: False,"},{"line_number":2389,"context_line":"                                \u0027version_id\u0027: None,"},{"line_number":2390,"context_line":"                                \u0027prefix\u0027: None,"},{"line_number":2391,"context_line":"                                \u0027header\u0027: [],"},{"line_number":2392,"context_line":"                            }"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_ad33fef6","line":2389,"updated":"2019-12-04 06:36:59.000000000","message":"how about an option to delete all versions? could make use of the bulk_delete","commit_id":"8ed8d678f7439264642ecaaf09359e460d215d1f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4ce4c4595e7baa3763def26ca7c75f9c9939b084","unresolved":false,"context_lines":[{"line_number":2474,"context_line":"                        break"},{"line_number":2475,"context_line":"                    else:"},{"line_number":2476,"context_line":"                        for res in self._delete_container("},{"line_number":2477,"context_line":"                                con, options\u003doptions):"},{"line_number":2478,"context_line":"                            yield res"},{"line_number":2479,"context_line":""},{"line_number":2480,"context_line":"                            # Cancel the remaining container deletes, but yield"}],"source_content_type":"text/x-python","patch_set":10,"id":"df33271e_bb92679e","line":2477,"range":{"start_line":2477,"start_character":45,"end_line":2477,"end_character":52},"updated":"2020-04-03 16:45:35.000000000","message":"What do we think about making this\n\n dict(options, versions\u003dTrue)\n\n?","commit_id":"f1845a6cfb70097ea6ca61fe88f1b82bfcea92f3"}],"swiftclient/shell.py":[{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"d7a9e98236005738b2a313497c8f064bd1aac153","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                        Number of threads to use for deleting containers."},{"line_number":91,"context_line":"                        Default is 10."},{"line_number":92,"context_line":"  --prefix \u003cprefix\u003e     Only delete objects beginning with \u003cprefix\u003e."},{"line_number":93,"context_line":"  --version-id          Delete specific version of a versioned object."},{"line_number":94,"context_line":"\u0027\u0027\u0027.strip(\"\\n\")"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_2d4dce70","line":93,"updated":"2019-12-04 06:36:59.000000000","message":"`--version-id \u003cversion_id\u003e` for consistency","commit_id":"8ed8d678f7439264642ecaaf09359e460d215d1f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f47f1d8045340311fe7ee8c4bd437196ba1f1d1a","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def st_delete(parser, args, output_manager, return_parser\u003dFalse):"},{"line_number":99,"context_line":"    parser.add_argument("},{"line_number":100,"context_line":"        \u0027-a\u0027, \u0027--all\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027yes_all\u0027,"},{"line_number":101,"context_line":"        default\u003dFalse, help\u003d\u0027Delete all containers and objects.\u0027)"},{"line_number":102,"context_line":"    parser.add_argument("},{"line_number":103,"context_line":"        \u0027-p\u0027, \u0027--prefix\u0027, dest\u003d\u0027prefix\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_9156a905","line":100,"updated":"2019-12-16 21:44:04.000000000","message":"Should we extend --all a bit? I uploaded some stuff:\n\n $ swift list c --versions\n test/__init__.py\n test/__pycache__/__init__.cpython-36.pyc\n test/functional/__init__.py\n test/functional/test_openstacksdk.py\n test/functional/test_swiftclient.py\n test/sample.conf\n test/unit/__init__.py\n test/unit/__pycache__/__init__.cpython-36.pyc\n test/unit/__pycache__/test_authv1.cpython-36.pyc\n test/unit/__pycache__/test_command_helpers.cpython-36.pyc\n test/unit/__pycache__/test_multithreading.cpython-36.pyc\n test/unit/__pycache__/test_service.cpython-36.pyc\n test/unit/__pycache__/test_shell.cpython-36.pyc\n test/unit/__pycache__/test_swiftclient.cpython-36.pyc\n test/unit/__pycache__/test_utils.cpython-36.pyc\n test/unit/__pycache__/utils.cpython-36.pyc\n test/unit/test_authv1.py\n test/unit/test_command_helpers.py\n test/unit/test_multithreading.py\n test/unit/test_service.py\n test/unit/test_shell.py\n test/unit/test_swiftclient.py\n test/unit/test_utils.py\n test/unit/utils.py\n\nThen went to delete the container:\n\n $ swift delete c\n test/functional/test_openstacksdk.py\n test/functional/test_swiftclient.py\n test/sample.conf\n test/unit/__pycache__/test_command_helpers.cpython-36.pyc\n test/unit/__pycache__/test_multithreading.cpython-36.pyc\n test/unit/__pycache__/test_service.cpython-36.pyc\n test/unit/__pycache__/test_shell.cpython-36.pyc\n test/unit/__pycache__/test_swiftclient.cpython-36.pyc\n test/unit/__pycache__/test_utils.cpython-36.pyc\n test/unit/test_swiftclient.py\n test/unit/test_utils.py\n test/unit/utils.py\n test/unit/test_multithreading.py\n test/unit/test_service.py\n test/unit/test_shell.py\n test/unit/__pycache__/utils.cpython-36.pyc\n test/unit/test_authv1.py\n test/unit/test_command_helpers.py\n test/__init__.py\n test/__pycache__/__init__.cpython-36.pyc\n test/functional/__init__.py\n test/unit/__init__.py\n test/unit/__pycache__/__init__.cpython-36.pyc\n test/unit/__pycache__/test_authv1.cpython-36.pyc\n Error Deleting: c: Container DELETE failed: http://saio:8080/v1/AUTH_test/c 400 Bad Request   b\u0027Delete all versions to delete container.\u0027\n\n...which (fairly reaonably) fails, though it\u0027s easy to miss the failure in all the success.\n\nMy first attempt to clean up (based on the list API) ended particularly badly:\n\n $ swift delete c --versions\n Traceback (most recent call last):\n   File \"/usr/local/bin/swift\", line 7, in \u003cmodule\u003e\n     exec(compile(f.read(), __file__, \u0027exec\u0027))\n   File \"/vagrant/python-swiftclient/bin/swift\", line 24, in \u003cmodule\u003e\n     sys.exit(main())\n   File \"/vagrant/python-swiftclient/swiftclient/shell.py\", line 2001, in main\n     globals()[\u0027st_%s\u0027 % args[0]](parser, argv[1:], output)\n   File \"/vagrant/python-swiftclient/swiftclient/shell.py\", line 181, in st_delete\n     if r.get(\u0027attempts\u0027) \u003e 1 else \u0027\u0027)\n TypeError: \u0027\u003e\u0027 not supported between instances of \u0027NoneType\u0027 and \u0027int\u0027\n\n(Though I think that may happen for missing objects on master, too :-/)\n\nSo I figured, why not try the other option that\u0027s kinda sorta like what I want?\n\n $ swift delete c --all\n  RequestsDependencyWarning)\n Usage: swift delete [--all] [--leave-segments]\n                     [--object-threads \u003cthreads\u003e]\n                     [--container-threads \u003cthreads\u003e]\n                     [--header \u003cheader:value\u003e]\n                     [--prefix \u003cprefix\u003e]\n                     [--version-id \u003cversion_id\u003e]\n                     [\u003ccontainer\u003e [\u003cobject\u003e] [...]]\n\n Delete a container or objects within a container.\n ...","commit_id":"6db651f05d17c1b2709cbe91c0336dcb85e0716d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"094a5b4275e7394dcc32cd23ac532abce53eb5bc","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def st_delete(parser, args, output_manager, return_parser\u003dFalse):"},{"line_number":99,"context_line":"    parser.add_argument("},{"line_number":100,"context_line":"        \u0027-a\u0027, \u0027--all\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027yes_all\u0027,"},{"line_number":101,"context_line":"        default\u003dFalse, help\u003d\u0027Delete all containers and objects.\u0027)"},{"line_number":102,"context_line":"    parser.add_argument("},{"line_number":103,"context_line":"        \u0027-p\u0027, \u0027--prefix\u0027, dest\u003d\u0027prefix\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_d105017b","line":100,"in_reply_to":"3fa7e38b_9156a905","updated":"2019-12-16 22:04:16.000000000","message":"Oh crud -- it\u0027s worse than I thought:\n\n $ swift delete --all\n Error Deleting: c: Container DELETE failed: http://saio:8080/v1/AUTH_test/c 400 Bad Request   b\u0027Delete all versions to delete container.\u0027\n\nI definitely feel like --all should be version-aware when we\u0027re trying to actually clear out an account... it\u0027s pretty unambiguous.","commit_id":"6db651f05d17c1b2709cbe91c0336dcb85e0716d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f47f1d8045340311fe7ee8c4bd437196ba1f1d1a","unresolved":false,"context_lines":[{"line_number":562,"context_line":"                        item_name \u003d subdir"},{"line_number":563,"context_line":"                    if not options[\u0027totals\u0027]:"},{"line_number":564,"context_line":"                        output_manager.print_msg("},{"line_number":565,"context_line":"                            \"%s %10s %8s %24s %s\","},{"line_number":566,"context_line":"                            byte_str, date, xtime, content_type, item_name)"},{"line_number":567,"context_line":"                total_bytes +\u003d item_bytes"},{"line_number":568,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_d1fe6103","line":565,"updated":"2019-12-16 21:44:04.000000000","message":"This should probably grow a version-id column -- and --versions should probably imply --long (in much the same way that --lh implies --long).\n\n--json is a nice escape hatch, but it doesn\u0027t take many items for it to become unwieldy.","commit_id":"6db651f05d17c1b2709cbe91c0336dcb85e0716d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f47f1d8045340311fe7ee8c4bd437196ba1f1d1a","unresolved":false,"context_lines":[{"line_number":691,"context_line":"        help\u003d\u0027Report sizes in human readable format similar to ls -lh.\u0027)"},{"line_number":692,"context_line":"    parser.add_argument("},{"line_number":693,"context_line":"        \u0027--version-id\u0027, action\u003d\u0027store\u0027, default\u003dNone,"},{"line_number":694,"context_line":"        help\u003d\u0027Report stat of a specific version of a versioned object\u0027)"},{"line_number":695,"context_line":"    parser.add_argument("},{"line_number":696,"context_line":"        \u0027-H\u0027, \u0027--header\u0027, action\u003d\u0027append\u0027, dest\u003d\u0027header\u0027,"},{"line_number":697,"context_line":"        default\u003d[],"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_51bd9101","line":694,"updated":"2019-12-16 21:44:04.000000000","message":"Hmm... this maybe should be smarter about 404s (IIRC that status is required/expected for S3?)\n\n vagrant@saio:/vagrant/python-swiftclient$ swift list c --versions --prefix\u003dtest/unit/utils.py --json\n [\n   {\n     \"bytes\": 0,\n     \"content_type\": \"application/x-deleted;swift_versions_deleted\u003d1\",\n     \"hash\": \"d41d8cd98f00b204e9800998ecf8427e\",\n     \"is_latest\": true,\n     \"last_modified\": \"2019-12-16T21:12:41.116780\",\n     \"name\": \"test/unit/utils.py\",\n     \"version_id\": \"1576530761.11582\"\n   },\n   {\n     \"bytes\": 21003,\n     \"content_type\": \"text/x-python\",\n     \"hash\": \"93a34c082e362dd77907103fdf17465c\",\n     \"is_latest\": false,\n     \"last_modified\": \"2019-12-16T21:12:40.670880\",\n     \"name\": \"test/unit/utils.py\",\n     \"version_id\": \"1576530548.60812\"\n   }\n ]\n $ swift stat c test/unit/utils.py --version-id\u003d1576530761.11582\n Object HEAD failed: http://saio:8080/v1/AUTH_test/c/test/unit/utils.py?version-id\u003d1576530761.11582 404 Not Found\n Failed Transaction ID: tx1b21b96ead1c43519ad12-005df7f6ea\n\nI mean, we\u0027ve got headers enough to have some more context...\n\n $ swift stat c test/unit/utils.py --version-id\u003d1576530761.11582 --debug\n ...\n INFO:swiftclient:RESP STATUS: 404 Not Found\n INFO:swiftclient:RESP HEADERS: {\u0027Content-Type\u0027: \u0027application/x-deleted;swift_versions_deleted\u003d1\u0027, \u0027X-Object-Version-Id\u0027: \u00271576530761.11582\u0027, \u0027Content-Length\u0027: \u00270\u0027, \u0027X-Trans-Id\u0027: \u0027tx74e260463ce148c29be9b-005df7f6cb\u0027, \u0027X-Openstack-Request-Id\u0027: \u0027tx74e260463ce148c29be9b-005df7f6cb\u0027, \u0027Date\u0027: \u0027Mon, 16 Dec 2019 21:27:39 GMT\u0027}\n ...\n\nI think I\u0027m more or less OK with this behavior for download, though -- so IDK, maybe it\u0027s fine here, too. Even with download, though, a warning like\n\n Warning: test/unit/utils.py at version-id 1576530761.11582 is a delete marker\n\nmight be more useful/informative.","commit_id":"6db651f05d17c1b2709cbe91c0336dcb85e0716d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4ce4c4595e7baa3763def26ca7c75f9c9939b084","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                             st_delete_help)"},{"line_number":139,"context_line":"        return"},{"line_number":140,"context_line":"    if options[\u0027versions\u0027] and len(args) \u003e\u003d 2:"},{"line_number":141,"context_line":"        exit(\u0027--versions option not allowed for object deletes\u0027)"},{"line_number":142,"context_line":"    if options[\u0027version_id\u0027] and len(args) \u003c 2:"},{"line_number":143,"context_line":"        exit(\u0027--version-id option only allowed for object deletes\u0027)"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"df33271e_b6a9dede","line":141,"updated":"2020-04-03 16:45:35.000000000","message":"IDK, I could see a use for that. Might be good follow-on work.","commit_id":"f1845a6cfb70097ea6ca61fe88f1b82bfcea92f3"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4ce4c4595e7baa3763def26ca7c75f9c9939b084","unresolved":false,"context_lines":[{"line_number":897,"context_line":"\u0027\u0027\u0027.strip(\u0027\\n\u0027)"},{"line_number":898,"context_line":""},{"line_number":899,"context_line":""},{"line_number":900,"context_line":"def st_copy(parser, args, output_manager, return_parser\u003dFalse):"},{"line_number":901,"context_line":"    parser.add_argument("},{"line_number":902,"context_line":"        \u0027-d\u0027, \u0027--destination\u0027, help\u003d\u0027The container and name of the \u0027"},{"line_number":903,"context_line":"        \u0027destination object\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"df33271e_9b3fa386","line":900,"updated":"2020-04-03 16:45:35.000000000","message":"Could be nice to have this support --version-id, too. Require that you only have a single \u003cobject\u003e specified, though.","commit_id":"f1845a6cfb70097ea6ca61fe88f1b82bfcea92f3"}],"test/unit/test_service.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"a0fd5554c8e0be7e1d0ab35bf579d9fa61af8356","unresolved":false,"context_lines":[{"line_number":567,"context_line":"        stub_headers \u003d {}"},{"line_number":568,"context_line":"        stub_resp \u003d []"},{"line_number":569,"context_line":"        mock_conn.post_account.return_value \u003d ("},{"line_number":570,"context_line":"            stub_headers, json.dumps(stub_resp))"},{"line_number":571,"context_line":"        obj_list \u003d [\u0027x%02d\u0027 % i for i in range(100)]"},{"line_number":572,"context_line":"        expected \u003d [{"},{"line_number":573,"context_line":"            \u0027action\u0027: u\u0027bulk_delete\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_453584a7","line":570,"range":{"start_line":570,"start_character":26,"end_line":570,"end_character":47},"updated":"2019-11-14 05:54:33.000000000","message":"body oughta be bytes on both py2 and py3 -- we want to encode() here.","commit_id":"da8f2ac9fe75d75f93b9d68944d59be97e0da428"}]}
