)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"91cad50b07934e529b6e0f5f861501097bbf9e48","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the used field of an allocation has the value of 0 then use that to"},{"line_number":10,"context_line":"signal that the allocation identified for that consumer and resource"},{"line_number":11,"context_line":"provider is to be deleted within the transactin of _set_allocations."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"No explicit deletion is required because _set_allocations deletes all"},{"line_number":14,"context_line":"allocations for a consumer before creating new ones. The trick here is"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7f287b81_41b58431","line":11,"range":{"start_line":11,"start_character":37,"end_line":11,"end_character":47},"updated":"2017-09-06 17:27:43.000000000","message":"transaction","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6b7d4e3dd634e5d186fcf52154087e7379808cf5","unresolved":false,"context_lines":[{"line_number":14,"context_line":"allocations for a consumer before creating new ones. The trick here is"},{"line_number":15,"context_line":"not creating another one if used is 0."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Functional tests have been added."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I585486a240d5c3b8e9ffec7223ca643b331463e6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"3f4b6375_267596fa","line":17,"range":{"start_line":17,"start_character":0,"end_line":17,"end_character":33},"updated":"2017-10-26 16:00:45.000000000","message":"just a nit: this kind of stuff (sausage-making) isn\u0027t necessary to put in the commit message..","commit_id":"c639a064ad3dae530486ca64ada1c941adcdbfb7"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"87163bb5497a8c02067f2473d174de680d5ae2c5","unresolved":false,"context_lines":[{"line_number":14,"context_line":"allocations for a consumer before creating new ones. The trick here is"},{"line_number":15,"context_line":"not creating another one if used is 0."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Functional tests have been added."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I585486a240d5c3b8e9ffec7223ca643b331463e6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"3f4b6375_4fe4250d","line":17,"range":{"start_line":17,"start_character":0,"end_line":17,"end_character":33},"in_reply_to":"3f4b6375_267596fa","updated":"2017-10-26 17:29:10.000000000","message":"I tend to think of such things as a useful aide-mémoire for the committer, the reviewer and anyone coming later who is trying to orient themselves.\n\nIn this particular case it is also a way of saying \"yes, I know there\u0027s no unit tests, that\u0027s because there are functional tests.\"","commit_id":"c639a064ad3dae530486ca64ada1c941adcdbfb7"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"26321cd2150cd1639e32207dd3e5d5192eb2e40a","unresolved":false,"context_lines":[{"line_number":18,"context_line":"/allocations where it will be possible to add, modify, and delete"},{"line_number":19,"context_line":"allocation records for \u003e1 consumer in one request. At the HTTP API"},{"line_number":20,"context_line":"layer it is currently not possible to provide empty allocations"},{"line_number":21,"context_line":"(to PUT /allocations/{consumer_uuid}) by virtua of JSONSchema. This"},{"line_number":22,"context_line":"will remain true. Only POST will use the functionality added in this"},{"line_number":23,"context_line":"commit."},{"line_number":24,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"3f4b6375_086f2e2b","line":21,"range":{"start_line":21,"start_character":41,"end_line":21,"end_character":47},"updated":"2017-10-27 14:05:12.000000000","message":"virtue","commit_id":"b118a9ab84e89e100b3962a48b91551ebbd48687"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"91cad50b07934e529b6e0f5f861501097bbf9e48","unresolved":false,"context_lines":[{"line_number":1814,"context_line":"        conn \u003d context.session.connection()"},{"line_number":1815,"context_line":""},{"line_number":1816,"context_line":"        # Short-circuit out if there are any allocations which already"},{"line_number":1817,"context_line":"        # appear to exist."},{"line_number":1818,"context_line":"        for alloc in allocs:"},{"line_number":1819,"context_line":"            if \u0027id\u0027 in alloc:"},{"line_number":1820,"context_line":"                raise exception.ObjectActionError(action\u003d\u0027create\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_81c6cc99","line":1817,"updated":"2017-09-06 17:27:43.000000000","message":"Not sure I grasp this change","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a213fb311e3112fa427f80c4496e846b7fa9bd6e","unresolved":false,"context_lines":[{"line_number":1814,"context_line":"        conn \u003d context.session.connection()"},{"line_number":1815,"context_line":""},{"line_number":1816,"context_line":"        # Short-circuit out if there are any allocations which already"},{"line_number":1817,"context_line":"        # appear to exist."},{"line_number":1818,"context_line":"        for alloc in allocs:"},{"line_number":1819,"context_line":"            if \u0027id\u0027 in alloc:"},{"line_number":1820,"context_line":"                raise exception.ObjectActionError(action\u003d\u0027create\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_180ea63a","line":1817,"in_reply_to":"7f287b81_01077c84","updated":"2017-09-07 22:43:30.000000000","message":"Okay maybe just mention an unrelated comment fixup to the commit message to make sure it\u0027s clear it\u0027s unrelated. I\u0027d just move it to another patch, but whatever you want. It just confused be because it didn\u0027t seem to reflect anything you were actually changing, and I expect that down the road someone bisecting through this would be similarly confused.","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"63a39ea09a1f1d59549479506fad7a90bcb8da08","unresolved":false,"context_lines":[{"line_number":1814,"context_line":"        conn \u003d context.session.connection()"},{"line_number":1815,"context_line":""},{"line_number":1816,"context_line":"        # Short-circuit out if there are any allocations which already"},{"line_number":1817,"context_line":"        # appear to exist."},{"line_number":1818,"context_line":"        for alloc in allocs:"},{"line_number":1819,"context_line":"            if \u0027id\u0027 in alloc:"},{"line_number":1820,"context_line":"                raise exception.ObjectActionError(action\u003d\u0027create\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_01077c84","line":1817,"in_reply_to":"7f287b81_81c6cc99","updated":"2017-09-06 17:40:54.000000000","message":"The original comment does not actually apply to this loop. It appears to be a holdover from some early formatting. The short circuit that happens here is if we\u0027ve got already written allocations. In one version of this change I had some work happening in this block, so figured I would fix the comment. Turned out I didn\u0027t need that additional work, but thought best to leave the comment fixed because it had me scratching my head for more than a few seconds.\n\nThe short circuit it previously mentioned does happen, but it rises out of _check_capacty_exceeded.\n\nI can lift that to a separate patch if desired, but meh","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"91cad50b07934e529b6e0f5f861501097bbf9e48","unresolved":false,"context_lines":[{"line_number":1832,"context_line":"        with conn.begin():"},{"line_number":1833,"context_line":"            # Don\u0027t check capacity when alloc.used is zero. That\u0027s not a valid"},{"line_number":1834,"context_line":"            # capacity but is used in this method to indicate a need for removal."},{"line_number":1835,"context_line":"            before_gens \u003d _check_capacity_exceeded(conn, [alloc for alloc in"},{"line_number":1836,"context_line":"                allocs if alloc.used \u003e 0])"},{"line_number":1837,"context_line":"            # First delete any existing allocations for this consumer."},{"line_number":1838,"context_line":"            for alloc in allocs:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_21e03826","line":1835,"updated":"2017-09-06 17:27:43.000000000","message":"Can you put this listcomp so it\u0027s vertically aligned? Much easier to read those if they\u0027re a tight-packed thing.","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"63a39ea09a1f1d59549479506fad7a90bcb8da08","unresolved":false,"context_lines":[{"line_number":1832,"context_line":"        with conn.begin():"},{"line_number":1833,"context_line":"            # Don\u0027t check capacity when alloc.used is zero. That\u0027s not a valid"},{"line_number":1834,"context_line":"            # capacity but is used in this method to indicate a need for removal."},{"line_number":1835,"context_line":"            before_gens \u003d _check_capacity_exceeded(conn, [alloc for alloc in"},{"line_number":1836,"context_line":"                allocs if alloc.used \u003e 0])"},{"line_number":1837,"context_line":"            # First delete any existing allocations for this consumer."},{"line_number":1838,"context_line":"            for alloc in allocs:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_61f7608d","line":1835,"in_reply_to":"7f287b81_21e03826","updated":"2017-09-06 17:40:54.000000000","message":"sure","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"91cad50b07934e529b6e0f5f861501097bbf9e48","unresolved":false,"context_lines":[{"line_number":1837,"context_line":"            # First delete any existing allocations for this consumer."},{"line_number":1838,"context_line":"            for alloc in allocs:"},{"line_number":1839,"context_line":"                consumer_id \u003d alloc.consumer_id"},{"line_number":1840,"context_line":"                _delete_current_allocs(conn, consumer_id)"},{"line_number":1841,"context_line":"            for alloc in allocs:"},{"line_number":1842,"context_line":"                if alloc.used \u003d\u003d 0:"},{"line_number":1843,"context_line":"                    rp \u003d alloc.resource_provider"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_a1b788f5","line":1840,"updated":"2017-09-06 17:27:43.000000000","message":"This is the step we do for zero-sized allocations, and then we skip the insert below on L1856, right?","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"63a39ea09a1f1d59549479506fad7a90bcb8da08","unresolved":false,"context_lines":[{"line_number":1837,"context_line":"            # First delete any existing allocations for this consumer."},{"line_number":1838,"context_line":"            for alloc in allocs:"},{"line_number":1839,"context_line":"                consumer_id \u003d alloc.consumer_id"},{"line_number":1840,"context_line":"                _delete_current_allocs(conn, consumer_id)"},{"line_number":1841,"context_line":"            for alloc in allocs:"},{"line_number":1842,"context_line":"                if alloc.used \u003d\u003d 0:"},{"line_number":1843,"context_line":"                    rp \u003d alloc.resource_provider"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_414584b3","line":1840,"in_reply_to":"7f287b81_a1b788f5","updated":"2017-09-06 17:40:54.000000000","message":"all previously existing allocations for all consumer_id are removed, even those allocations we have created that have a used \u003d\u003d 0, then those that we created with 0 skip the insert. I\u0027ll make a more verbose set of comments.\n\nThere is some redundancy here that could be cleaned up. If all the allocs have the same consumer_id we\u0027re doing extra work. I think I\u0027ll fix that.","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"91cad50b07934e529b6e0f5f861501097bbf9e48","unresolved":false,"context_lines":[{"line_number":1841,"context_line":"            for alloc in allocs:"},{"line_number":1842,"context_line":"                if alloc.used \u003d\u003d 0:"},{"line_number":1843,"context_line":"                    rp \u003d alloc.resource_provider"},{"line_number":1844,"context_line":"                    if rp.uuid not in before_gens:"},{"line_number":1845,"context_line":"                        before_gens[rp.uuid] \u003d rp"},{"line_number":1846,"context_line":"                    continue"},{"line_number":1847,"context_line":"                consumer_id \u003d alloc.consumer_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_814b6c29","line":1844,"updated":"2017-09-06 17:27:43.000000000","message":"Hmm, probably need a comment here. I guess this is patching up before_gens, which will now only include things we checked capacity for?","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"63a39ea09a1f1d59549479506fad7a90bcb8da08","unresolved":false,"context_lines":[{"line_number":1841,"context_line":"            for alloc in allocs:"},{"line_number":1842,"context_line":"                if alloc.used \u003d\u003d 0:"},{"line_number":1843,"context_line":"                    rp \u003d alloc.resource_provider"},{"line_number":1844,"context_line":"                    if rp.uuid not in before_gens:"},{"line_number":1845,"context_line":"                        before_gens[rp.uuid] \u003d rp"},{"line_number":1846,"context_line":"                    continue"},{"line_number":1847,"context_line":"                consumer_id \u003d alloc.consumer_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_214278ac","line":1844,"in_reply_to":"7f287b81_814b6c29","updated":"2017-09-06 17:40:54.000000000","message":"right","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"91cad50b07934e529b6e0f5f861501097bbf9e48","unresolved":false,"context_lines":[{"line_number":1861,"context_line":"            # this will raise a ConcurrentUpdateDetected which can be caught"},{"line_number":1862,"context_line":"            # by the caller to choose to try again. It will also rollback the"},{"line_number":1863,"context_line":"            # transaction so that these changes always happen atomically."},{"line_number":1864,"context_line":"            for rp in before_gens.values():"},{"line_number":1865,"context_line":"                rp.generation \u003d _increment_provider_generation(conn, rp)"},{"line_number":1866,"context_line":""},{"line_number":1867,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_41ed84ee","line":1864,"range":{"start_line":1864,"start_character":22,"end_line":1864,"end_character":33},"updated":"2017-09-06 17:27:43.000000000","message":"So, I know this didn\u0027t change, but I\u0027m not positive I understand why this is called \"before_gens\". It seems even less appropriate when we\u0027re patching it up later on L1845. Maybe this should be just \"affected_rps\" or something?","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"63a39ea09a1f1d59549479506fad7a90bcb8da08","unresolved":false,"context_lines":[{"line_number":1861,"context_line":"            # this will raise a ConcurrentUpdateDetected which can be caught"},{"line_number":1862,"context_line":"            # by the caller to choose to try again. It will also rollback the"},{"line_number":1863,"context_line":"            # transaction so that these changes always happen atomically."},{"line_number":1864,"context_line":"            for rp in before_gens.values():"},{"line_number":1865,"context_line":"                rp.generation \u003d _increment_provider_generation(conn, rp)"},{"line_number":1866,"context_line":""},{"line_number":1867,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_a10f8886","line":1864,"in_reply_to":"7f287b81_41ed84ee","updated":"2017-09-06 17:40:54.000000000","message":"yeah, it\u0027s a weird name. Since I\u0027m changing both places it is used, I\u0027ll go ahead and rename it to something that makes more sense.","commit_id":"ebd253c3d572e7ccfc188541ca071c75b4e07b9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"d35423bcda58fda4b1b1bfb24a63bc59064c7495","unresolved":false,"context_lines":[{"line_number":1848,"context_line":"                        visited_rps[rp.uuid] \u003d rp"},{"line_number":1849,"context_line":"                    continue"},{"line_number":1850,"context_line":"                consumer_id \u003d alloc.consumer_id"},{"line_number":1851,"context_line":"                if consumer_id not in seen_consumers:"},{"line_number":1852,"context_line":"                    alloc.ensure_consumer_project_user(conn)"},{"line_number":1853,"context_line":"                    seen_consumers.add(consumer_id)"},{"line_number":1854,"context_line":"                rp \u003d alloc.resource_provider"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f5c4f37_e76be21c","line":1851,"updated":"2017-09-21 00:08:02.000000000","message":"this seen stuff may belong in the parent","commit_id":"8381425b4439ac533b439cea0d557a586f9c8ff8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"b576c9a6ea0b999a6951cbcf24e6d118c8e61615","unresolved":false,"context_lines":[{"line_number":1819,"context_line":"            # First delete any existing allocations for any consumers. This"},{"line_number":1820,"context_line":"            # provides a clean slate for the consumers mentioned in the list of"},{"line_number":1821,"context_line":"            # allocations being manipulated."},{"line_number":1822,"context_line":"            consumer_ids \u003d set([alloc.consumer_id for alloc in allocs])"},{"line_number":1823,"context_line":"            for consumer_id in consumer_ids:"},{"line_number":1824,"context_line":"                _delete_current_allocs(conn, consumer_id)"},{"line_number":1825,"context_line":"            # Don\u0027t check capacity when alloc.used is zero. That\u0027s not a valid"},{"line_number":1826,"context_line":"            # capacity but is used in this method to indicate a need for"},{"line_number":1827,"context_line":"            # removal. _check_capacity_exceeded will raise a"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f515b1d_9d8d5733","line":1824,"range":{"start_line":1822,"start_character":0,"end_line":1824,"end_character":57},"updated":"2017-09-25 15:27:58.000000000","message":"This seems like a refactor. Can we do that in a separate patch?","commit_id":"f937dd8604442aeeff110ca085f77bb6da7e7ea6"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"7571d26d4cee8d40d1cbe9507fd0a93c42b938fe","unresolved":false,"context_lines":[{"line_number":1819,"context_line":"            # First delete any existing allocations for any consumers. This"},{"line_number":1820,"context_line":"            # provides a clean slate for the consumers mentioned in the list of"},{"line_number":1821,"context_line":"            # allocations being manipulated."},{"line_number":1822,"context_line":"            consumer_ids \u003d set([alloc.consumer_id for alloc in allocs])"},{"line_number":1823,"context_line":"            for consumer_id in consumer_ids:"},{"line_number":1824,"context_line":"                _delete_current_allocs(conn, consumer_id)"},{"line_number":1825,"context_line":"            # Don\u0027t check capacity when alloc.used is zero. That\u0027s not a valid"},{"line_number":1826,"context_line":"            # capacity but is used in this method to indicate a need for"},{"line_number":1827,"context_line":"            # removal. _check_capacity_exceeded will raise a"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f515b1d_0ee5a8a8","line":1824,"range":{"start_line":1822,"start_character":0,"end_line":1824,"end_character":57},"in_reply_to":"7f515b1d_9d8d5733","updated":"2017-09-25 17:57:50.000000000","message":"Done","commit_id":"f937dd8604442aeeff110ca085f77bb6da7e7ea6"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ffc0697f46e6d29e60ea5da2592b2a7a0d758c75","unresolved":false,"context_lines":[{"line_number":1819,"context_line":"            # First delete any existing allocations for any consumers. This"},{"line_number":1820,"context_line":"            # provides a clean slate for the consumers mentioned in the list of"},{"line_number":1821,"context_line":"            # allocations being manipulated."},{"line_number":1822,"context_line":"            consumer_ids \u003d set([alloc.consumer_id for alloc in allocs])"},{"line_number":1823,"context_line":"            for consumer_id in consumer_ids:"},{"line_number":1824,"context_line":"                _delete_current_allocs(conn, consumer_id)"},{"line_number":1825,"context_line":"            # Don\u0027t check capacity when alloc.used is zero. That\u0027s not a valid"},{"line_number":1826,"context_line":"            # capacity but is used in this method to indicate a need for"},{"line_number":1827,"context_line":"            # removal. _check_capacity_exceeded will raise a"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f515b1d_586daa30","line":1824,"range":{"start_line":1822,"start_character":0,"end_line":1824,"end_character":57},"in_reply_to":"7f515b1d_9d8d5733","updated":"2017-09-25 16:37:15.000000000","message":"If you like, sure.","commit_id":"f937dd8604442aeeff110ca085f77bb6da7e7ea6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"b576c9a6ea0b999a6951cbcf24e6d118c8e61615","unresolved":false,"context_lines":[{"line_number":1822,"context_line":"            consumer_ids \u003d set([alloc.consumer_id for alloc in allocs])"},{"line_number":1823,"context_line":"            for consumer_id in consumer_ids:"},{"line_number":1824,"context_line":"                _delete_current_allocs(conn, consumer_id)"},{"line_number":1825,"context_line":"            # Don\u0027t check capacity when alloc.used is zero. That\u0027s not a valid"},{"line_number":1826,"context_line":"            # capacity but is used in this method to indicate a need for"},{"line_number":1827,"context_line":"            # removal. _check_capacity_exceeded will raise a"},{"line_number":1828,"context_line":"            # ResourceClassNotFound if any allocation is using a resource class"},{"line_number":1829,"context_line":"            # that does not exist."}],"source_content_type":"text/x-python","patch_set":11,"id":"7f515b1d_5d111fac","line":1826,"range":{"start_line":1825,"start_character":60,"end_line":1826,"end_character":22},"updated":"2017-09-25 15:27:58.000000000","message":"Is it not valid due to the step size cannot be 0?","commit_id":"f937dd8604442aeeff110ca085f77bb6da7e7ea6"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"7571d26d4cee8d40d1cbe9507fd0a93c42b938fe","unresolved":false,"context_lines":[{"line_number":1822,"context_line":"            consumer_ids \u003d set([alloc.consumer_id for alloc in allocs])"},{"line_number":1823,"context_line":"            for consumer_id in consumer_ids:"},{"line_number":1824,"context_line":"                _delete_current_allocs(conn, consumer_id)"},{"line_number":1825,"context_line":"            # Don\u0027t check capacity when alloc.used is zero. That\u0027s not a valid"},{"line_number":1826,"context_line":"            # capacity but is used in this method to indicate a need for"},{"line_number":1827,"context_line":"            # removal. _check_capacity_exceeded will raise a"},{"line_number":1828,"context_line":"            # ResourceClassNotFound if any allocation is using a resource class"},{"line_number":1829,"context_line":"            # that does not exist."}],"source_content_type":"text/x-python","patch_set":11,"id":"7f515b1d_c9a42abc","line":1826,"range":{"start_line":1825,"start_character":60,"end_line":1826,"end_character":22},"in_reply_to":"7f515b1d_5d111fac","updated":"2017-09-25 17:57:50.000000000","message":"i\u0027ve adjust the comment somewhat","commit_id":"f937dd8604442aeeff110ca085f77bb6da7e7ea6"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ffc0697f46e6d29e60ea5da2592b2a7a0d758c75","unresolved":false,"context_lines":[{"line_number":1822,"context_line":"            consumer_ids \u003d set([alloc.consumer_id for alloc in allocs])"},{"line_number":1823,"context_line":"            for consumer_id in consumer_ids:"},{"line_number":1824,"context_line":"                _delete_current_allocs(conn, consumer_id)"},{"line_number":1825,"context_line":"            # Don\u0027t check capacity when alloc.used is zero. That\u0027s not a valid"},{"line_number":1826,"context_line":"            # capacity but is used in this method to indicate a need for"},{"line_number":1827,"context_line":"            # removal. _check_capacity_exceeded will raise a"},{"line_number":1828,"context_line":"            # ResourceClassNotFound if any allocation is using a resource class"},{"line_number":1829,"context_line":"            # that does not exist."}],"source_content_type":"text/x-python","patch_set":11,"id":"7f515b1d_3879ce2e","line":1826,"range":{"start_line":1825,"start_character":60,"end_line":1826,"end_character":22},"in_reply_to":"7f515b1d_5d111fac","updated":"2017-09-25 16:37:15.000000000","message":"min resource consumption is 1: https://github.com/openstack/nova/blob/835e4806b64fa533958b96cb708170acdd14923a/nova/api/openstack/placement/handlers/allocation.py#L58\n\nSo the \"hack\" here is to use 0 to indicate need for delete only.","commit_id":"f937dd8604442aeeff110ca085f77bb6da7e7ea6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"b576c9a6ea0b999a6951cbcf24e6d118c8e61615","unresolved":false,"context_lines":[{"line_number":1827,"context_line":"            # removal. _check_capacity_exceeded will raise a"},{"line_number":1828,"context_line":"            # ResourceClassNotFound if any allocation is using a resource class"},{"line_number":1829,"context_line":"            # that does not exist."},{"line_number":1830,"context_line":"            visited_rps \u003d _check_capacity_exceeded(conn,"},{"line_number":1831,"context_line":"                                                   [alloc for alloc in"},{"line_number":1832,"context_line":"                                                    allocs if alloc.used \u003e 0])"},{"line_number":1833,"context_line":"            seen_consumers \u003d set()"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f515b1d_88e753e5","line":1830,"range":{"start_line":1830,"start_character":12,"end_line":1830,"end_character":23},"updated":"2017-09-25 15:27:58.000000000","message":"Would it be even better to name it updated_rps or changed_rps?","commit_id":"f937dd8604442aeeff110ca085f77bb6da7e7ea6"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ffc0697f46e6d29e60ea5da2592b2a7a0d758c75","unresolved":false,"context_lines":[{"line_number":1827,"context_line":"            # removal. _check_capacity_exceeded will raise a"},{"line_number":1828,"context_line":"            # ResourceClassNotFound if any allocation is using a resource class"},{"line_number":1829,"context_line":"            # that does not exist."},{"line_number":1830,"context_line":"            visited_rps \u003d _check_capacity_exceeded(conn,"},{"line_number":1831,"context_line":"                                                   [alloc for alloc in"},{"line_number":1832,"context_line":"                                                    allocs if alloc.used \u003e 0])"},{"line_number":1833,"context_line":"            seen_consumers \u003d set()"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f515b1d_18229201","line":1830,"range":{"start_line":1830,"start_character":12,"end_line":1830,"end_character":23},"in_reply_to":"7f515b1d_88e753e5","updated":"2017-09-25 16:37:15.000000000","message":"They haven\u0027t changed. I chose visited because I wanted it to mean \"those resource providers that we _looked_ at when in _check_capacity_exceeded\". Later on in the block of code, the allocations will be updated, and the generation should change, but the resource provider itself does not.","commit_id":"f937dd8604442aeeff110ca085f77bb6da7e7ea6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"b576c9a6ea0b999a6951cbcf24e6d118c8e61615","unresolved":false,"context_lines":[{"line_number":1839,"context_line":"                # to visited_rps so its generation will be checked at the end"},{"line_number":1840,"context_line":"                # of the transaction."},{"line_number":1841,"context_line":"                if alloc.used \u003d\u003d 0:"},{"line_number":1842,"context_line":"                    rp \u003d alloc.resource_provider"},{"line_number":1843,"context_line":"                    if rp.uuid not in visited_rps:"},{"line_number":1844,"context_line":"                        visited_rps[rp.uuid] \u003d rp"},{"line_number":1845,"context_line":"                    continue"},{"line_number":1846,"context_line":"                consumer_id \u003d alloc.consumer_id"},{"line_number":1847,"context_line":"                # Only set consumer \u003c-\u003e project/user association if we"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f515b1d_28517f63","line":1844,"range":{"start_line":1842,"start_character":1,"end_line":1844,"end_character":49},"updated":"2017-09-25 15:27:58.000000000","message":"could we simply say?\n    visited_rps[rp.uuid] \u003d rp\n\nIt would mean that we add it again if it is already there but that is not change the end result and we can remove the \u0027if\u0027","commit_id":"f937dd8604442aeeff110ca085f77bb6da7e7ea6"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"7571d26d4cee8d40d1cbe9507fd0a93c42b938fe","unresolved":false,"context_lines":[{"line_number":1839,"context_line":"                # to visited_rps so its generation will be checked at the end"},{"line_number":1840,"context_line":"                # of the transaction."},{"line_number":1841,"context_line":"                if alloc.used \u003d\u003d 0:"},{"line_number":1842,"context_line":"                    rp \u003d alloc.resource_provider"},{"line_number":1843,"context_line":"                    if rp.uuid not in visited_rps:"},{"line_number":1844,"context_line":"                        visited_rps[rp.uuid] \u003d rp"},{"line_number":1845,"context_line":"                    continue"},{"line_number":1846,"context_line":"                consumer_id \u003d alloc.consumer_id"},{"line_number":1847,"context_line":"                # Only set consumer \u003c-\u003e project/user association if we"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f515b1d_e98a4619","line":1844,"range":{"start_line":1842,"start_character":1,"end_line":1844,"end_character":49},"in_reply_to":"7f515b1d_28517f63","updated":"2017-09-25 17:57:50.000000000","message":"Done","commit_id":"f937dd8604442aeeff110ca085f77bb6da7e7ea6"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ffc0697f46e6d29e60ea5da2592b2a7a0d758c75","unresolved":false,"context_lines":[{"line_number":1839,"context_line":"                # to visited_rps so its generation will be checked at the end"},{"line_number":1840,"context_line":"                # of the transaction."},{"line_number":1841,"context_line":"                if alloc.used \u003d\u003d 0:"},{"line_number":1842,"context_line":"                    rp \u003d alloc.resource_provider"},{"line_number":1843,"context_line":"                    if rp.uuid not in visited_rps:"},{"line_number":1844,"context_line":"                        visited_rps[rp.uuid] \u003d rp"},{"line_number":1845,"context_line":"                    continue"},{"line_number":1846,"context_line":"                consumer_id \u003d alloc.consumer_id"},{"line_number":1847,"context_line":"                # Only set consumer \u003c-\u003e project/user association if we"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f515b1d_98b202e6","line":1844,"range":{"start_line":1842,"start_character":1,"end_line":1844,"end_character":49},"in_reply_to":"7f515b1d_28517f63","updated":"2017-09-25 16:37:15.000000000","message":"sure","commit_id":"f937dd8604442aeeff110ca085f77bb6da7e7ea6"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1dc1388381875e4acc8cfbe32c6d110e4350e287","unresolved":false,"context_lines":[{"line_number":1799,"context_line":"            # POST /allocations is implemented it will for the special case of"},{"line_number":1800,"context_line":"            # atomically setting and removing different allocations in the same"},{"line_number":1801,"context_line":"            # request. _check_capacity_exceeded will raise a"},{"line_number":1802,"context_line":"            # ResourceClassNotFound # if any allocation is using a resource"},{"line_number":1803,"context_line":"            # class that does not exist."},{"line_number":1804,"context_line":"            visited_rps \u003d _check_capacity_exceeded(conn,"},{"line_number":1805,"context_line":"                                                   [alloc for alloc in"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f4b6375_4ceb0177","line":1802,"range":{"start_line":1802,"start_character":36,"end_line":1802,"end_character":37},"updated":"2017-10-27 08:35:42.000000000","message":"nit: I guess we don\u0027t need this here","commit_id":"b118a9ab84e89e100b3962a48b91551ebbd48687"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e603a71ab659f28e82ed67d92e12f35be5280d66","unresolved":false,"context_lines":[{"line_number":1799,"context_line":"            # POST /allocations is implemented it will for the special case of"},{"line_number":1800,"context_line":"            # atomically setting and removing different allocations in the same"},{"line_number":1801,"context_line":"            # request. _check_capacity_exceeded will raise a"},{"line_number":1802,"context_line":"            # ResourceClassNotFound # if any allocation is using a resource"},{"line_number":1803,"context_line":"            # class that does not exist."},{"line_number":1804,"context_line":"            visited_rps \u003d _check_capacity_exceeded(conn,"},{"line_number":1805,"context_line":"                                                   [alloc for alloc in"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f4b6375_99d5b61e","line":1802,"range":{"start_line":1802,"start_character":36,"end_line":1802,"end_character":37},"in_reply_to":"3f4b6375_4ceb0177","updated":"2017-10-27 09:18:49.000000000","message":"Yeah, that was a reflowing the paragraph oversight. I\u0027ll fix it if, as you say, there\u0027s another version.","commit_id":"b118a9ab84e89e100b3962a48b91551ebbd48687"}],"nova/tests/functional/db/test_resource_provider.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"26321cd2150cd1639e32207dd3e5d5192eb2e40a","unresolved":false,"context_lines":[{"line_number":1429,"context_line":"        allocation_list \u003d rp_obj.AllocationList("},{"line_number":1430,"context_line":"            self.ctx,"},{"line_number":1431,"context_line":"            objects\u003d[allocation1, allocation2],"},{"line_number":1432,"context_line":"        )"},{"line_number":1433,"context_line":"        allocation_list.create_all()"},{"line_number":1434,"context_line":""},{"line_number":1435,"context_line":"        allocations \u003d rp_obj.AllocationList.get_all_by_consumer_id("}],"source_content_type":"text/x-python","patch_set":17,"id":"3f4b6375_23de8b3d","line":1432,"updated":"2017-10-27 14:05:12.000000000","message":"I\u0027m surprise ed or dan hasn\u0027t scolded you on this and other abominations of closing parens on a line of its own.","commit_id":"b118a9ab84e89e100b3962a48b91551ebbd48687"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"fd695258fc8bbc6edddd45cdd94e1b313d5aca07","unresolved":false,"context_lines":[{"line_number":1429,"context_line":"        allocation_list \u003d rp_obj.AllocationList("},{"line_number":1430,"context_line":"            self.ctx,"},{"line_number":1431,"context_line":"            objects\u003d[allocation1, allocation2],"},{"line_number":1432,"context_line":"        )"},{"line_number":1433,"context_line":"        allocation_list.create_all()"},{"line_number":1434,"context_line":""},{"line_number":1435,"context_line":"        allocations \u003d rp_obj.AllocationList.get_all_by_consumer_id("}],"source_content_type":"text/x-python","patch_set":17,"id":"3f4b6375_63f5a356","line":1432,"in_reply_to":"3f4b6375_23de8b3d","updated":"2017-10-27 14:22:12.000000000","message":"just lucky i guess","commit_id":"b118a9ab84e89e100b3962a48b91551ebbd48687"}]}
