)]}'
{"swift/common/utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"789630c0a250000202967d3c8511c4c2bb439c55","unresolved":false,"context_lines":[{"line_number":4708,"context_line":"    Otherwise, in run-once mode, look at the \u0027policies\u0027 keyword argument."},{"line_number":4709,"context_line":"    This is the value of the \"--policies\" command-line option. In"},{"line_number":4710,"context_line":"    run-forever mode or if no --policies option was provided, an Everything"},{"line_number":4711,"context_line":"    object will be returned."},{"line_number":4712,"context_line":""},{"line_number":4713,"context_line":"    The procedures for devices and partitions are similar."},{"line_number":4714,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_fd4a5f81","line":4711,"updated":"2018-04-06 00:49:01.000000000","message":"this is handled at the call site in the db_replicator","commit_id":"6fa737679fd5510b2033c32b351ddcc6a8ccf89b"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"9b3051c69a7a7ab3a932bdf6f46fa768830d157a","unresolved":false,"context_lines":[{"line_number":4708,"context_line":"    Otherwise, in run-once mode, look at the \u0027policies\u0027 keyword argument."},{"line_number":4709,"context_line":"    This is the value of the \"--policies\" command-line option. In"},{"line_number":4710,"context_line":"    run-forever mode or if no --policies option was provided, an Everything"},{"line_number":4711,"context_line":"    object will be returned."},{"line_number":4712,"context_line":""},{"line_number":4713,"context_line":"    The procedures for devices and partitions are similar."},{"line_number":4714,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_f05a6f81","line":4711,"in_reply_to":"bf659307_fd4a5f81","updated":"2018-04-07 00:58:47.000000000","message":"Yep, you\u0027re right. I\u0027d had it doing that before, but then I ended up with some ugly hack around the conditional recon dumps in the replicator (\"only dump if I had no overrides\"), so I backed it out.","commit_id":"6fa737679fd5510b2033c32b351ddcc6a8ccf89b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"789630c0a250000202967d3c8511c4c2bb439c55","unresolved":false,"context_lines":[{"line_number":4712,"context_line":""},{"line_number":4713,"context_line":"    The procedures for devices and partitions are similar."},{"line_number":4714,"context_line":""},{"line_number":4715,"context_line":"    :return: a 3-tuple (policies, devices, partitions)"},{"line_number":4716,"context_line":"    \"\"\""},{"line_number":4717,"context_line":"    run_once \u003d kwargs.get(\u0027once\u0027, False)"},{"line_number":4718,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_dd499b8b","line":4715,"updated":"2018-04-06 00:49:01.000000000","message":"meh, a dict is kinda self documenting, or maybe a named tuple!?","commit_id":"6fa737679fd5510b2033c32b351ddcc6a8ccf89b"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"9b3051c69a7a7ab3a932bdf6f46fa768830d157a","unresolved":false,"context_lines":[{"line_number":4712,"context_line":""},{"line_number":4713,"context_line":"    The procedures for devices and partitions are similar."},{"line_number":4714,"context_line":""},{"line_number":4715,"context_line":"    :return: a 3-tuple (policies, devices, partitions)"},{"line_number":4716,"context_line":"    \"\"\""},{"line_number":4717,"context_line":"    run_once \u003d kwargs.get(\u0027once\u0027, False)"},{"line_number":4718,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_10ee0388","line":4715,"in_reply_to":"bf659307_dd499b8b","updated":"2018-04-07 00:58:47.000000000","message":"Named tuple sounds good. I\u0027ll do that.\n\nThe dict worked pretty well, but I wound up typing \"override\" so much that it lost all meaning.","commit_id":"6fa737679fd5510b2033c32b351ddcc6a8ccf89b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"789630c0a250000202967d3c8511c4c2bb439c55","unresolved":false,"context_lines":[{"line_number":4737,"context_line":"        partitions \u003d ["},{"line_number":4738,"context_line":"            int(p) for p in list_from_csv(kwargs.get(\u0027partitions\u0027))]"},{"line_number":4739,"context_line":"    else:"},{"line_number":4740,"context_line":"        partitions \u003d []"},{"line_number":4741,"context_line":""},{"line_number":4742,"context_line":"    return policies, devices, partitions"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_bd3947f3","line":4740,"updated":"2018-04-06 00:49:01.000000000","message":"this logic is a lot like override_policies, i guess they\u0027re all sorta similar...","commit_id":"6fa737679fd5510b2033c32b351ddcc6a8ccf89b"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"9b3051c69a7a7ab3a932bdf6f46fa768830d157a","unresolved":false,"context_lines":[{"line_number":4737,"context_line":"        partitions \u003d ["},{"line_number":4738,"context_line":"            int(p) for p in list_from_csv(kwargs.get(\u0027partitions\u0027))]"},{"line_number":4739,"context_line":"    else:"},{"line_number":4740,"context_line":"        partitions \u003d []"},{"line_number":4741,"context_line":""},{"line_number":4742,"context_line":"    return policies, devices, partitions"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_707f3fab","line":4740,"in_reply_to":"bf659307_bd3947f3","updated":"2018-04-07 00:58:47.000000000","message":"Yep. I toyed with a thing like this:\n\n    def extract_option(opt, transform_fn):\n        override_key \u003d \"override_%s\" % opt\n        if override_key in kwargs:\n            return kwargs[override_key]\n        elif run_once:\n            return [transform_fn(x) for x in list_from_csv(kwargs.get(opt))]\n        else:\n            return []\n\n    devices \u003d extract_option(\u0027devices\u0027, lambda x: x)\n    partitions \u003d extract_option(\u0027partitions\u0027, int)\n    policies \u003d extract_option(\u0027policies\u0027, int)\n    \n\nIMO, it just made things harder to read. If there were 8 or 10 or more of these things, I\u0027d probably go for the refactored one to avoid all the giant repeated blocks, but at 3 things, I\u0027m inclined to just leave the simple, straightforward, somewhat-repetitive code.\n\nThat\u0027s not a strong preference, though, so if you disagree I\u0027ll put the factored thing in.","commit_id":"6fa737679fd5510b2033c32b351ddcc6a8ccf89b"}]}
