)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"bc1640cefc16426751efecc76cd49137da5808ce","unresolved":true,"context_lines":[{"line_number":9,"context_line":"Some deployments may need to run the relinker as root -- for example,"},{"line_number":10,"context_line":"because /etc/swift/swift.conf is only readable by root. In that case,"},{"line_number":11,"context_line":"we need to drop back to the swift user before relinking, or the"},{"line_number":12,"context_line":"newly-created partitions will not be readable by the object-server."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ifb9a6acdbc81b68788aa167b4e0eb915620b92f4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"9ec57a22_77f89ad1","line":12,"updated":"2021-02-08 21:10:45.000000000","message":"+1\n\nI changed my swift.conf to be rw by root only, then ran as vagrant:\n\n  vagrant@saio:~/swift$  swift-object-relinker relink /etc/swift/object-server/1.conf.d/ --device foo --user vagrant\nTraceback (most recent call last):\n  File \"/home/vagrant/.local/bin/swift-object-relinker\", line 7, in \u003cmodule\u003e\n    exec(compile(f.read(), __file__, \u0027exec\u0027))\n  File \"/vagrant/swift/bin/swift-object-relinker\", line 23, in \u003cmodule\u003e\n    sys.exit(main(sys.argv[1:]))\n  File \"/vagrant/swift/swift/cli/relinker.py\", line 422, in main\n    objects_per_second\u003dobjects_per_second)\n  File \"/vagrant/swift/swift/cli/relinker.py\", line 193, in relink\n    policy.load_ring(swift_dir)\n  File \"/vagrant/swift/swift/common/storage_policy.py\", line 377, in load_ring\n    self.object_ring \u003d Ring(swift_dir, ring_name\u003dself.ring_name)\n  File \"/vagrant/swift/swift/common/ring/ring.py\", line 275, in __init__\n    validate_configuration()\n  File \"/vagrant/swift/swift/common/utils.py\", line 568, in validate_configuration\n    validate_hash_conf()\n  File \"/vagrant/swift/swift/common/utils.py\", line 250, in validate_hash_conf\n    with open(SWIFT_CONF_FILE) as swift_conf_file:\nIOError: [Errno 13] Permission denied: \u0027/etc/swift/swift.conf\u0027\n\nThe stack trace is bit deceptive because it is raised *after* drop_privileges is called, so how is it not also raised when I run using sudo with --user vagrant?\n\nTim helped me see that validate_hash_conf() is tried *early* when the utils module is loaded, but any exception is squashed if that fails. Hence the later exception when running as vagrant, when validate_hash_conf is called again while loading rings.\n\nWhen running as root, the early validate_hash_conf() succeeds and the later call, after privileges are dropped to vagrant, is not required, so no exception.","commit_id":"3c3d6b76119d0a92140d51ad602bdd7526184ea2"}],"bin/swift-object-relinker":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"da638c6b8cb2becde2c3f5a09c389399e5d5b9f5","unresolved":true,"context_lines":[{"line_number":34,"context_line":"                        help\u003d\u0027Don\\\u0027t test if disk is mounted\u0027,"},{"line_number":35,"context_line":"                        action\u003d\"store_true\", dest\u003d\u0027skip_mount_check\u0027)"},{"line_number":36,"context_line":"    parser.add_argument(\u0027--swift-user\u0027, default\u003dNone, dest\u003d\u0027swift_user\u0027"},{"line_number":37,"context_line":"                        help\u003d\u0027Drop privileges to this user before relinking\u0027)"},{"line_number":38,"context_line":"    parser.add_argument(\u0027--logfile\u0027, default\u003dNone,"},{"line_number":39,"context_line":"                        dest\u003d\u0027logfile\u0027, help\u003d\u0027Set log file name\u0027)"},{"line_number":40,"context_line":"    parser.add_argument(\u0027--debug\u0027, default\u003dFalse, action\u003d\u0027store_true\u0027,"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"9a5680b9_eede3bb1","line":37,"updated":"2021-01-25 19:44:04.000000000","message":"i guess most of the time, no drop_priv is fine - but we \"can\u0027t\" default to \"swift\" either because of e.g. vsaio/vagrant","commit_id":"3899f72cce7a2edc209fe4573b0c26bd8751c80f"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"73aa6a0892ad2f9f78bdb0c52609ced370024be2","unresolved":true,"context_lines":[{"line_number":33,"context_line":"    parser.add_argument(\u0027--skip-mount-check\u0027, default\u003dFalse,"},{"line_number":34,"context_line":"                        help\u003d\u0027Don\\\u0027t test if disk is mounted\u0027,"},{"line_number":35,"context_line":"                        action\u003d\"store_true\", dest\u003d\u0027skip_mount_check\u0027)"},{"line_number":36,"context_line":"    parser.add_argument(\u0027--swift-user\u0027, default\u003dNone, dest\u003d\u0027swift_user\u0027"},{"line_number":37,"context_line":"                        help\u003d\u0027Drop privileges to this user before relinking\u0027)"},{"line_number":38,"context_line":"    parser.add_argument(\u0027--logfile\u0027, default\u003dNone,"},{"line_number":39,"context_line":"                        dest\u003d\u0027logfile\u0027, help\u003d\u0027Set log file name\u0027)"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"247addcc_a79f3456","line":36,"updated":"2021-02-01 04:13:19.000000000","message":"Missing the comma (,) at the end of this line.","commit_id":"27b674d5fe5ba8408c3d5b24532e859501bb32e6"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"ede36027919732562662701c1e909b801f95fe64","unresolved":true,"context_lines":[{"line_number":33,"context_line":"    parser.add_argument(\u0027--skip-mount-check\u0027, default\u003dFalse,"},{"line_number":34,"context_line":"                        help\u003d\u0027Don\\\u0027t test if disk is mounted\u0027,"},{"line_number":35,"context_line":"                        action\u003d\"store_true\", dest\u003d\u0027skip_mount_check\u0027)"},{"line_number":36,"context_line":"    parser.add_argument(\u0027--swift-user\u0027, default\u003dNone, dest\u003d\u0027swift_user\u0027"},{"line_number":37,"context_line":"                        help\u003d\u0027Drop privileges to this user before relinking\u0027)"},{"line_number":38,"context_line":"    parser.add_argument(\u0027--logfile\u0027, default\u003dNone,"},{"line_number":39,"context_line":"                        dest\u003d\u0027logfile\u0027, help\u003d\u0027Set log file name\u0027)"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"68d415f3_f58f7954","line":36,"in_reply_to":"247addcc_a79f3456","updated":"2021-02-01 18:39:17.000000000","message":"I need to look into why this didn\u0027t get caught by https://zuul.opendev.org/t/openstack/build/81ce1583a6cd49209b6437777ff8ac72/log/job-output.txt#693-695 ...","commit_id":"27b674d5fe5ba8408c3d5b24532e859501bb32e6"}]}
