)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7d938792f831334bd88da14e340e57fde626f812","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit switches the install setup for the bin/ script to use pbr"},{"line_number":10,"context_line":"console_script entrypoints. Letting pbr handle the actual script has a"},{"line_number":11,"context_line":"number of advantages, but the primary motivator for this patch is to"},{"line_number":12,"context_line":"have the shebang for installed binary be set at install time to the"},{"line_number":13,"context_line":"version of python used to do the install. This is necessary as part of"},{"line_number":14,"context_line":"the python 3 bring up."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"To enable using the entrypoint the scripts need to be in the packaged"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba5201f7_bb127007","line":13,"range":{"start_line":11,"start_character":26,"end_line":13,"end_character":40},"updated":"2017-01-05 00:20:32.000000000","message":"I\u0027m confused. I thought distutils (or *somebody*) already did that for scripts listed in setup.cfg? Seems to work:\n\n(.venv3) $ cat `which swift-init`\n#!/home/vagrant/.venv3/bin/python3\n# EASY-INSTALL-DEV-SCRIPT: \u0027swift\u003d\u003d2.12.1.dev11\u0027,\u0027swift-init\u0027\n__requires__ \u003d \u0027swift\u003d\u003d2.12.1.dev11\u0027\nimport sys\nfrom pkg_resources import require\nrequire(\u0027swift\u003d\u003d2.12.1.dev11\u0027)\ndel require\n__file__ \u003d \u0027/home/vagrant/swift/bin/swift-init\u0027\nif sys.version_info \u003c (3, 0):\n    execfile(__file__)\nelse:\n    exec(compile(open(__file__).read(), __file__, \u0027exec\u0027))\n\n(Full log at http://paste.openstack.org/show/593926/)","commit_id":"2630546ce4c471ceda23f993a67d4c2e1e3269e9"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f8da6dc985e7b22287222b32217f2ab1aaed721f","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"To enable using the entrypoint the scripts need to be in the packaged"},{"line_number":17,"context_line":"python names space and have a callable we can use for the entrypoint."},{"line_number":18,"context_line":"This involves moving the scripts from bin/ to swift/bin and changing"},{"line_number":19,"context_line":"the file names so they can be imported. (ie change dashes to underscores"},{"line_number":20,"context_line":"and add .py) Then adding a function, main(), in each file so we can have"},{"line_number":21,"context_line":"the entrypoint call that function."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba5201f7_377e7319","line":18,"updated":"2017-01-05 17:34:01.000000000","message":"Historically we\u0027ve been moving most of the console script code into swift.cli - why create a new namespace/module?","commit_id":"f0a79f04bb36ba4e2ea76dc7f68cbaf019482170"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f8da6dc985e7b22287222b32217f2ab1aaed721f","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"For backwards compatibility the old location of the scripts in the repo"},{"line_number":24,"context_line":"are symlinked to the new files. So if anyone was directly calling them"},{"line_number":25,"context_line":"from a local repo clone that will still work."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Change-Id: I11379636ee59331d4a06e207e3dc96d649eacf35"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba5201f7_17aecf97","line":25,"updated":"2017-01-05 17:34:01.000000000","message":"You should get a second opinion, but I strongly prefer not to do this part.\n\nIt just adds overhead when future us adds new console scripts, or worse ends up being inconsistently applied.  It only effects development workflows - rip the bandaid off.","commit_id":"f0a79f04bb36ba4e2ea76dc7f68cbaf019482170"}],"swift/bin/swift_account_audit.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f8da6dc985e7b22287222b32217f2ab1aaed721f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# Copyright (c) 2010-2012 OpenStack Foundation"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5201f7_b705037b","line":1,"updated":"2017-01-05 17:34:01.000000000","message":"perhaps we want to drop these?  and the if __main__ blocks?","commit_id":"f0a79f04bb36ba4e2ea76dc7f68cbaf019482170"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f8da6dc985e7b22287222b32217f2ab1aaed721f","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        if self.object_exceptions:"},{"line_number":348,"context_line":"            _print_stat(\"Exceptions\", self.object_exceptions)"},{"line_number":349,"context_line":"        if self.object_checksum_mismatch:"},{"line_number":350,"context_line":"            _print_stat(\"MD5 Mismatch\", self.object_checksum_mismatch)"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"def main():"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5201f7_9749dfb9","line":350,"updated":"2017-01-05 17:34:01.000000000","message":"I expect dropping in this code from /bin is going to drive down test coverage metrics slightly - if anyone is tracking that they may need to normalize the old data.","commit_id":"f0a79f04bb36ba4e2ea76dc7f68cbaf019482170"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f8da6dc985e7b22287222b32217f2ab1aaed721f","unresolved":false,"context_lines":[{"line_number":377,"context_line":"    auditor.print_stats()"},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"},{"line_number":380,"context_line":"    main()"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5201f7_771e3bbc","line":380,"updated":"2017-01-05 17:34:01.000000000","message":"if these if __main__ blocks stick around I think it would be surprising that they don\u0027t use sys.exit(main()) to allow returning error strings from the main method to signal non-zero exit.","commit_id":"f0a79f04bb36ba4e2ea76dc7f68cbaf019482170"}]}
