)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"99e6f767c3595ca1490c0ea98617cb6f9d96899d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"e1a6bff2_e4ca8868","updated":"2023-04-11 10:47:02.000000000","message":"LGTM\n\nbefore, Ctrl-C and CtrlD:\n```\nvagrant@vagrant:~$ swift-ring-builder /etc/swift/object.ring.gz remove 127.0.0.1:6010 127.0.0.2:6020\nNote: using /etc/swift/object.builder instead of /etc/swift/object.ring.gz as builder file\nMatched more than one device:\n    d0r1z1-127.0.0.1:6010R127.0.0.1:6010/sdb1_\"\"\n    d1r1z2-127.0.0.2:6020R127.0.0.2:6020/sdb2_\"\"\nAre you sure you want to remove these 2 devices? (y/N) ^CTraceback (most recent call last):\n  File \"/home/vagrant/.local/bin/swift-ring-builder\", line 7, in \u003cmodule\u003e\n    exec(compile(f.read(), __file__, \u0027exec\u0027))\n  File \"/vagrant/swift/bin/swift-ring-builder\", line 37, in \u003cmodule\u003e\n    sys.exit(main())\n  File \"/vagrant/swift/swift/cli/ringbuilder.py\", line 1696, in main\n    getattr(Commands, command, Commands.unknown)()\n  File \"/vagrant/swift/swift/cli/ringbuilder.py\", line 1014, in remove\n    check_devs(devs, input_question, opts, abort_msg)\n  File \"/vagrant/swift/swift/cli/ringbuilder.py\", line 197, in check_devs\n    if not opts.yes and input(input_question) !\u003d \u0027y\u0027:\nKeyboardInterrupt\n\nvagrant@vagrant:~$ swift-ring-builder /etc/swift/object.ring.gz remove 127.0.0.1:6010 127.0.0.2:6020\nNote: using /etc/swift/object.builder instead of /etc/swift/object.ring.gz as builder file\nMatched more than one device:\n    d0r1z1-127.0.0.1:6010R127.0.0.1:6010/sdb1_\"\"\n    d1r1z2-127.0.0.2:6020R127.0.0.2:6020/sdb2_\"\"\nAre you sure you want to remove these 2 devices? (y/N) Traceback (most recent call last):\n  File \"/home/vagrant/.local/bin/swift-ring-builder\", line 7, in \u003cmodule\u003e\n    exec(compile(f.read(), __file__, \u0027exec\u0027))\n  File \"/vagrant/swift/bin/swift-ring-builder\", line 37, in \u003cmodule\u003e\n    sys.exit(main())\n  File \"/vagrant/swift/swift/cli/ringbuilder.py\", line 1696, in main\n    getattr(Commands, command, Commands.unknown)()\n  File \"/vagrant/swift/swift/cli/ringbuilder.py\", line 1014, in remove\n    check_devs(devs, input_question, opts, abort_msg)\n  File \"/vagrant/swift/swift/cli/ringbuilder.py\", line 197, in check_devs\n    if not opts.yes and input(input_question) !\u003d \u0027y\u0027:\nEOFError\n```\n\nafter, Ctrl-C and CtrlD:\n```\n\nvagrant@vagrant:~$ swift-ring-builder /etc/swift/object.ring.gz remove 127.0.0.1:6010 127.0.0.2:6020\nNote: using /etc/swift/object.builder instead of /etc/swift/object.ring.gz as builder file\nMatched more than one device:\n    d0r1z1-127.0.0.1:6010R127.0.0.1:6010/sdb1_\"\"\n    d1r1z2-127.0.0.2:6020R127.0.0.2:6020/sdb2_\"\"\nAre you sure you want to remove these 2 devices? (y/N) ^CAborting device removals\nvagrant@vagrant:~$ swift-ring-builder /etc/swift/object.ring.gz remove 127.0.0.1:6010 127.0.0.2:6020\nNote: using /etc/swift/object.builder instead of /etc/swift/object.ring.gz as builder file\nMatched more than one device:\n    d0r1z1-127.0.0.1:6010R127.0.0.1:6010/sdb1_\"\"\n    d1r1z2-127.0.0.2:6020R127.0.0.2:6020/sdb2_\"\"\nAre you sure you want to remove these 2 devices? (y/N) Aborting device removals\n```","commit_id":"f264b53a2ed8146738d74d1bbe5c1bd679661b16"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"b8cd99afdc018ef4f92b414a1b3d502610a16eca","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"0f943b56_01d80fd7","updated":"2023-04-12 07:10:14.000000000","message":"Yeah I agree with the NIT but not something to block.","commit_id":"f264b53a2ed8146738d74d1bbe5c1bd679661b16"}],"swift/cli/ringbuilder.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"b8cd99afdc018ef4f92b414a1b3d502610a16eca","unresolved":true,"context_lines":[{"line_number":183,"context_line":"    return parsed_devs"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"def check_devs(devs, input_question, opts, abort_msg):"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    if not devs:"},{"line_number":189,"context_line":"        print(\u0027Search value matched 0 devices.\\n\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"b3390ae5_94f8c3e5","side":"PARENT","line":186,"updated":"2023-04-12 07:10:14.000000000","message":"Oh I see, this is the only place we use the input() so it only needs to be done here.. I was looking around thinking surely there are more.. but turns out no, we just call check_devs when we ask for approval.","commit_id":"57ce156a7f5cecd58fb4d83acbe1416d583275d1"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"99e6f767c3595ca1490c0ea98617cb6f9d96899d","unresolved":true,"context_lines":[{"line_number":197,"context_line":"        try:"},{"line_number":198,"context_line":"            abort \u003d not opts.yes and input(input_question) !\u003d \u0027y\u0027"},{"line_number":199,"context_line":"        except (EOFError, KeyboardInterrupt):"},{"line_number":200,"context_line":"            abort \u003d True"},{"line_number":201,"context_line":"        if abort:"},{"line_number":202,"context_line":"            print(abort_msg)"},{"line_number":203,"context_line":"            exit(EXIT_ERROR)"}],"source_content_type":"text/x-python","patch_set":2,"id":"978231a9_3fe7402c","line":200,"updated":"2023-04-11 10:47:02.000000000","message":"nit: printing a newline here would make things prettier","commit_id":"f264b53a2ed8146738d74d1bbe5c1bd679661b16"}]}
