)]}'
{"swift/container/reconciler.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"406bb5e4fb3879316e9e2f941a78cb47496fc09d","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    elif info[\u0027status_changed_at\u0027] \u003e remote_info[\u0027status_changed_at\u0027]:"},{"line_number":92,"context_line":"        return 1"},{"line_number":93,"context_line":"    else:"},{"line_number":94,"context_line":"        return 0"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"def incorrect_policy_index(info, remote_info):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_0fe43d0c","line":94,"updated":"2018-05-29 05:26:12.000000000","message":"this does put repeats the same code 3x. So we could just add:\n\n  def cmp(x, y):\n      return (x \u003e y) - (x \u003c y)\n\nAs a helper method and be done with it. It seem this is the only place we use it. So in this file is fine.","commit_id":"8c1ab594f47db657fe8606f904b6d80936ed3393"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"1341b7635fdf7fcdc4bb0bd3a13033ce824d008c","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    elif info[\u0027status_changed_at\u0027] \u003e remote_info[\u0027status_changed_at\u0027]:"},{"line_number":92,"context_line":"        return 1"},{"line_number":93,"context_line":"    else:"},{"line_number":94,"context_line":"        return 0"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"def incorrect_policy_index(info, remote_info):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_5ea04443","line":94,"in_reply_to":"5f7c97a3_0fe43d0c","updated":"2018-06-14 23:05:38.000000000","message":"Sure. I think I\u0027m going to spell it out, though, since (personally) I don\u0027t find\n\n (x \u003e y) - (x \u003c y)\n\nparticularly obvious.\n\nOf course, on the other hand -- spelling everything out lets http://logs.openstack.org/78/570478/2/check/swift-tox-py27/b9781d6/job-output.txt.gz#_2018-05-25_23_13_21_303698 show that line 87 isn\u0027t currently covered by tests... but then, maybe that\u0027s because it almost certainly shouldn\u0027t happen unless the policies match...","commit_id":"8c1ab594f47db657fe8606f904b6d80936ed3393"}],"swift/obj/reconstructor.py":[{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"a2aa6f03bcfb3447e947fe4cf052c3c454854723","unresolved":false,"context_lines":[{"line_number":998,"context_line":"    def get_local_devices(self):"},{"line_number":999,"context_line":"        \"\"\"Returns a set of all local devices in all EC policies.\"\"\""},{"line_number":1000,"context_line":"        policy2devices \u003d self.get_policy2devices()"},{"line_number":1001,"context_line":"        return reduce(set.union, ("},{"line_number":1002,"context_line":"            set(d[\u0027device\u0027] for d in devices)"},{"line_number":1003,"context_line":"            for devices in policy2devices.values()), set())"},{"line_number":1004,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_ce60a7a8","side":"PARENT","line":1001,"range":{"start_line":1001,"start_character":15,"end_line":1001,"end_character":21},"updated":"2018-05-25 00:19:18.000000000","message":"could use functools.reduce(); that\u0027s still around in py3\n\nI don\u0027t have a preference either way.","commit_id":"cd2641dcca19235967876472671614b714965f0e"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"06ee33cc10e8c7dd2366a8b2f28de5d0e15df26a","unresolved":false,"context_lines":[{"line_number":1018,"context_line":"        policy2devices \u003d self.get_policy2devices()"},{"line_number":1019,"context_line":"        local_devices \u003d set()"},{"line_number":1020,"context_line":"        for devices in policy2devices.values():"},{"line_number":1021,"context_line":"            local_devices.update(d[\u0027device\u0027] for d in devices)"},{"line_number":1022,"context_line":"        return local_devices"},{"line_number":1023,"context_line":""},{"line_number":1024,"context_line":"    def collect_parts(self, override_devices\u003dNone, override_partitions\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_46c84074","line":1021,"updated":"2018-06-18 19:51:12.000000000","message":"This seems highly suspicious to me. Look at this test:\n\ndef get_local_devices(devices):\n    local_devices \u003d set()\n    for d in devices:\n        local_devices.update(d)\n    return local_devices\n\ndef main():\n    locdev \u003d get_local_devices([\u0027sda\u0027, \u0027sdb\u0027])\n    print(\"%r\" % (locdev,))\n\nIt prints - hold onto your chair - the following:\n\nset([\u0027a\u0027, \u0027s\u0027, \u0027b\u0027, \u0027d\u0027])","commit_id":"a718cb3f1f7645d1d7beaa716b542655e97ec518"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"e260f9d8f3bfacd0644b69b135b9e625b19f433d","unresolved":false,"context_lines":[{"line_number":1018,"context_line":"        policy2devices \u003d self.get_policy2devices()"},{"line_number":1019,"context_line":"        local_devices \u003d set()"},{"line_number":1020,"context_line":"        for devices in policy2devices.values():"},{"line_number":1021,"context_line":"            local_devices.update(d[\u0027device\u0027] for d in devices)"},{"line_number":1022,"context_line":"        return local_devices"},{"line_number":1023,"context_line":""},{"line_number":1024,"context_line":"    def collect_parts(self, override_devices\u003dNone, override_partitions\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_fbdf8335","line":1021,"in_reply_to":"5f7c97a3_46c84074","updated":"2018-06-20 00:17:59.000000000","message":"Yeah, but the values in policy2devices are lists, not strings, so this is more akin to\n\n def get_local_devices(devices):\n     local_devices \u003d set()\n     local_devices.update(d for d in devices)\n     return local_devices\n\nor\n\n def get_local_devices(*devices):\n     local_devices \u003d set()\n     for d in devices:\n         local_devices.update(d)\n     return local_devices\n\neither of which gets you what you want:\n\n \u003e\u003e\u003e main()\n set([\u0027sda\u0027, \u0027sdb\u0027])\n\nFWIW, I did this because I found the whole\n\n reduce(set.union, (set(... for ...) for ...), set())\n\nconstruct confusing -- maybe I didn\u0027t go far enough in spelling out what\u0027s actually going on, though?","commit_id":"a718cb3f1f7645d1d7beaa716b542655e97ec518"}]}
