)]}'
{"nova/api/openstack/placement/handlers/allocation.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"726382cb07075b8bab55f8cc61a6d8d273b4d517","unresolved":false,"context_lines":[{"line_number":344,"context_line":"        # NOTE(jaypipes): This will only occur 1.28+. The JSONSchema will"},{"line_number":345,"context_line":"        # prevent an empty allocations object from being passed when there is"},{"line_number":346,"context_line":"        # no consumer generation, so this is safe to do."},{"line_number":347,"context_line":"        util.ensure_consumer(context, consumer_uuid, data.get(\u0027project_id\u0027),"},{"line_number":348,"context_line":"             data.get(\u0027user_id\u0027), data.get(\u0027consumer_generation\u0027),"},{"line_number":349,"context_line":"             want_version)"},{"line_number":350,"context_line":"        allocations \u003d rp_obj.AllocationList.get_all_by_consumer_id("}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_2525bebf","line":347,"range":{"start_line":347,"start_character":13,"end_line":347,"end_character":28},"updated":"2018-07-03 20:49:32.000000000","message":"What about this fella?","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f3387adea8bf6802b564144b3dbf9fe2167c5982","unresolved":false,"context_lines":[{"line_number":344,"context_line":"        # NOTE(jaypipes): This will only occur 1.28+. The JSONSchema will"},{"line_number":345,"context_line":"        # prevent an empty allocations object from being passed when there is"},{"line_number":346,"context_line":"        # no consumer generation, so this is safe to do."},{"line_number":347,"context_line":"        util.ensure_consumer(context, consumer_uuid, data.get(\u0027project_id\u0027),"},{"line_number":348,"context_line":"             data.get(\u0027user_id\u0027), data.get(\u0027consumer_generation\u0027),"},{"line_number":349,"context_line":"             want_version)"},{"line_number":350,"context_line":"        allocations \u003d rp_obj.AllocationList.get_all_by_consumer_id("}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_68c62b4c","line":347,"range":{"start_line":347,"start_character":13,"end_line":347,"end_character":28},"in_reply_to":"5f7c97a3_2525bebf","updated":"2018-07-03 21:23:59.000000000","message":"If allocation_data is None, the consumer is never new, and therefore we don\u0027t need to track whether to delete the auto-created consumer record.","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"726382cb07075b8bab55f8cc61a6d8d273b4d517","unresolved":false,"context_lines":[{"line_number":369,"context_line":"            allocation_objects.extend(new_allocations)"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    def _delete_consumer():"},{"line_number":372,"context_line":"        if created_new_consumer and consumer is not None:"},{"line_number":373,"context_line":"            consumer.delete()"},{"line_number":374,"context_line":"            LOG.debug(\"Deleted auto-created consumer with consumer UUID %s \""},{"line_number":375,"context_line":"                      \"after failed allocation\", consumer_uuid)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_a85523fb","line":372,"updated":"2018-07-03 20:49:32.000000000","message":"Looks a bit weird - would we ever have a case where created_new_consumer is True and consumer is None? We can only have the case that created_new_consumer is False and consumer is not None when the consumer already exists, right?","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f3387adea8bf6802b564144b3dbf9fe2167c5982","unresolved":false,"context_lines":[{"line_number":369,"context_line":"            allocation_objects.extend(new_allocations)"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    def _delete_consumer():"},{"line_number":372,"context_line":"        if created_new_consumer and consumer is not None:"},{"line_number":373,"context_line":"            consumer.delete()"},{"line_number":374,"context_line":"            LOG.debug(\"Deleted auto-created consumer with consumer UUID %s \""},{"line_number":375,"context_line":"                      \"after failed allocation\", consumer_uuid)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_28bcb3b3","line":372,"in_reply_to":"5f7c97a3_a85523fb","updated":"2018-07-03 21:23:59.000000000","message":"Yeah, I can just make it:\n\n if created_new_consumer:\n ...","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"726382cb07075b8bab55f8cc61a6d8d273b4d517","unresolved":false,"context_lines":[{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    def _delete_consumer():"},{"line_number":372,"context_line":"        if created_new_consumer and consumer is not None:"},{"line_number":373,"context_line":"            consumer.delete()"},{"line_number":374,"context_line":"            LOG.debug(\"Deleted auto-created consumer with consumer UUID %s \""},{"line_number":375,"context_line":"                      \"after failed allocation\", consumer_uuid)"},{"line_number":376,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_a86e83c5","line":373,"updated":"2018-07-03 20:49:32.000000000","message":"Since this is essentially an internal rollback, not sure if you want to try/except and log anything if this fails but not bypass the original exception - could use excutils.save_and_reraise_exception for this also.","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f3387adea8bf6802b564144b3dbf9fe2167c5982","unresolved":false,"context_lines":[{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    def _delete_consumer():"},{"line_number":372,"context_line":"        if created_new_consumer and consumer is not None:"},{"line_number":373,"context_line":"            consumer.delete()"},{"line_number":374,"context_line":"            LOG.debug(\"Deleted auto-created consumer with consumer UUID %s \""},{"line_number":375,"context_line":"                      \"after failed allocation\", consumer_uuid)"},{"line_number":376,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_88e067cd","line":373,"in_reply_to":"5f7c97a3_a86e83c5","updated":"2018-07-03 21:23:59.000000000","message":"Pretty sure we don\u0027t use save_and_reraise_exception() anywhere (yet?) in the placement code. So, for now I\u0027ll just wrap and log.","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"726382cb07075b8bab55f8cc61a6d8d273b4d517","unresolved":false,"context_lines":[{"line_number":399,"context_line":"            _(\u0027Inventory and/or allocations changed while attempting to \u0027"},{"line_number":400,"context_line":"              \u0027allocate: %(error)s\u0027) % {\u0027error\u0027: exc},"},{"line_number":401,"context_line":"              comment\u003derrors.CONCURRENT_UPDATE)"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"    req.response.status \u003d 204"},{"line_number":404,"context_line":"    req.response.content_type \u003d None"},{"line_number":405,"context_line":"    return req.response"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_25fe1e06","line":402,"updated":"2018-07-03 20:49:32.000000000","message":"What if we 500? Don\u0027t you want to delete the consumer in any failure situation?","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f3387adea8bf6802b564144b3dbf9fe2167c5982","unresolved":false,"context_lines":[{"line_number":399,"context_line":"            _(\u0027Inventory and/or allocations changed while attempting to \u0027"},{"line_number":400,"context_line":"              \u0027allocate: %(error)s\u0027) % {\u0027error\u0027: exc},"},{"line_number":401,"context_line":"              comment\u003derrors.CONCURRENT_UPDATE)"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"    req.response.status \u003d 204"},{"line_number":404,"context_line":"    req.response.content_type \u003d None"},{"line_number":405,"context_line":"    return req.response"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_48cecf5b","line":402,"in_reply_to":"5f7c97a3_25fe1e06","updated":"2018-07-03 21:23:59.000000000","message":"You mean put an except: catchall block above? I can do that, sure.","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"726382cb07075b8bab55f8cc61a6d8d273b4d517","unresolved":false,"context_lines":[{"line_number":462,"context_line":"        consumers[consumer_uuid] \u003d consumer"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"    def _delete_new_consumers():"},{"line_number":465,"context_line":"        for consumer in new_consumers_created:"},{"line_number":466,"context_line":"            consumer.delete()"},{"line_number":467,"context_line":"            LOG.debug(\"Deleted auto-created consumer with consumer UUID %s \""},{"line_number":468,"context_line":"                      \"after failed allocation\", consumer.uuid)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_6864ebe5","line":465,"updated":"2018-07-03 20:49:32.000000000","message":"same comment above for excutils.save_and_reraise_exception so you don\u0027t overwrite the original failure that the user sees","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f3387adea8bf6802b564144b3dbf9fe2167c5982","unresolved":false,"context_lines":[{"line_number":462,"context_line":"        consumers[consumer_uuid] \u003d consumer"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"    def _delete_new_consumers():"},{"line_number":465,"context_line":"        for consumer in new_consumers_created:"},{"line_number":466,"context_line":"            consumer.delete()"},{"line_number":467,"context_line":"            LOG.debug(\"Deleted auto-created consumer with consumer UUID %s \""},{"line_number":468,"context_line":"                      \"after failed allocation\", consumer.uuid)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_c803bf75","line":465,"in_reply_to":"5f7c97a3_6864ebe5","updated":"2018-07-03 21:23:59.000000000","message":"ack, will do a catch and log.","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"726382cb07075b8bab55f8cc61a6d8d273b4d517","unresolved":false,"context_lines":[{"line_number":493,"context_line":"            _(\u0027Inventory and/or allocations changed while attempting to \u0027"},{"line_number":494,"context_line":"              \u0027allocate: %(error)s\u0027) % {\u0027error\u0027: exc},"},{"line_number":495,"context_line":"              comment\u003derrors.CONCURRENT_UPDATE)"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    req.response.status \u003d 204"},{"line_number":498,"context_line":"    req.response.content_type \u003d None"},{"line_number":499,"context_line":"    return req.response"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_680dcb33","line":496,"updated":"2018-07-03 20:49:32.000000000","message":"same as above about 500 errors","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f3387adea8bf6802b564144b3dbf9fe2167c5982","unresolved":false,"context_lines":[{"line_number":493,"context_line":"            _(\u0027Inventory and/or allocations changed while attempting to \u0027"},{"line_number":494,"context_line":"              \u0027allocate: %(error)s\u0027) % {\u0027error\u0027: exc},"},{"line_number":495,"context_line":"              comment\u003derrors.CONCURRENT_UPDATE)"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    req.response.status \u003d 204"},{"line_number":498,"context_line":"    req.response.content_type \u003d None"},{"line_number":499,"context_line":"    return req.response"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_88f94783","line":496,"in_reply_to":"5f7c97a3_680dcb33","updated":"2018-07-03 21:23:59.000000000","message":"Done","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5256f7060be05a0363461b039e869370450e839f","unresolved":false,"context_lines":[{"line_number":360,"context_line":"            context, consumer_uuid, data.get(\u0027project_id\u0027),"},{"line_number":361,"context_line":"            data.get(\u0027user_id\u0027), data.get(\u0027consumer_generation\u0027),"},{"line_number":362,"context_line":"            want_version)"},{"line_number":363,"context_line":"        for rp_uuid, allocation in allocation_data.items():"},{"line_number":364,"context_line":"            resource_provider \u003d rp_objs[rp_uuid]"},{"line_number":365,"context_line":"            new_allocations \u003d _new_allocations(context,"},{"line_number":366,"context_line":"                                               resource_provider,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_fc33cf5f","line":363,"updated":"2018-07-04 16:05:26.000000000","message":"aw, I liked that long name","commit_id":"c19390e586858794f4a0bcfbe368ffaee2157d7e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f8c797240ebf454cfa85cbd8ccb6c604372cc56c","unresolved":false,"context_lines":[{"line_number":360,"context_line":"            context, consumer_uuid, data.get(\u0027project_id\u0027),"},{"line_number":361,"context_line":"            data.get(\u0027user_id\u0027), data.get(\u0027consumer_generation\u0027),"},{"line_number":362,"context_line":"            want_version)"},{"line_number":363,"context_line":"        for rp_uuid, allocation in allocation_data.items():"},{"line_number":364,"context_line":"            resource_provider \u003d rp_objs[rp_uuid]"},{"line_number":365,"context_line":"            new_allocations \u003d _new_allocations(context,"},{"line_number":366,"context_line":"                                               resource_provider,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_1e922da0","line":363,"in_reply_to":"5f7c97a3_fc33cf5f","updated":"2018-07-05 15:30:41.000000000","message":"Done","commit_id":"c19390e586858794f4a0bcfbe368ffaee2157d7e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5256f7060be05a0363461b039e869370450e839f","unresolved":false,"context_lines":[{"line_number":368,"context_line":"                                               allocation[\u0027resources\u0027])"},{"line_number":369,"context_line":"            allocation_objects.extend(new_allocations)"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    def _delete_consumer():"},{"line_number":372,"context_line":"        if created_new_consumer:"},{"line_number":373,"context_line":"            try:"},{"line_number":374,"context_line":"                consumer.delete()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_9c25fb0c","line":371,"updated":"2018-07-04 16:05:26.000000000","message":"Is there a reason other than convenience that you did this here rather than passing parameters to a top level function?","commit_id":"c19390e586858794f4a0bcfbe368ffaee2157d7e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f8c797240ebf454cfa85cbd8ccb6c604372cc56c","unresolved":false,"context_lines":[{"line_number":368,"context_line":"                                               allocation[\u0027resources\u0027])"},{"line_number":369,"context_line":"            allocation_objects.extend(new_allocations)"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    def _delete_consumer():"},{"line_number":372,"context_line":"        if created_new_consumer:"},{"line_number":373,"context_line":"            try:"},{"line_number":374,"context_line":"                consumer.delete()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_de87d55a","line":371,"in_reply_to":"5f7c97a3_9c25fb0c","updated":"2018-07-05 15:30:41.000000000","message":"Done","commit_id":"c19390e586858794f4a0bcfbe368ffaee2157d7e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5256f7060be05a0363461b039e869370450e839f","unresolved":false,"context_lines":[{"line_number":381,"context_line":"    allocations \u003d rp_obj.AllocationList("},{"line_number":382,"context_line":"        context, objects\u003dallocation_objects)"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    try:"},{"line_number":385,"context_line":"        allocations.create_all()"},{"line_number":386,"context_line":"        LOG.debug(\"Successfully wrote allocations %s\", allocations)"},{"line_number":387,"context_line":"    # InvalidInventory is a parent for several exceptions that"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_bc679751","line":384,"updated":"2018-07-04 16:05:26.000000000","message":"Did you consider nesting this entire try except block in another try which catches Exception, calls _delete_consumer and then reraises? Then you don\u0027t have to remember to duplicate _delete_consumer if we add yet another except clause through here.","commit_id":"c19390e586858794f4a0bcfbe368ffaee2157d7e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f8c797240ebf454cfa85cbd8ccb6c604372cc56c","unresolved":false,"context_lines":[{"line_number":381,"context_line":"    allocations \u003d rp_obj.AllocationList("},{"line_number":382,"context_line":"        context, objects\u003dallocation_objects)"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    try:"},{"line_number":385,"context_line":"        allocations.create_all()"},{"line_number":386,"context_line":"        LOG.debug(\"Successfully wrote allocations %s\", allocations)"},{"line_number":387,"context_line":"    # InvalidInventory is a parent for several exceptions that"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_beb8d911","line":384,"in_reply_to":"5f7c97a3_bc679751","updated":"2018-07-05 15:30:41.000000000","message":"Done","commit_id":"c19390e586858794f4a0bcfbe368ffaee2157d7e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5256f7060be05a0363461b039e869370450e839f","unresolved":false,"context_lines":[{"line_number":483,"context_line":"    # and consumer generations (if applicable) check all in one go."},{"line_number":484,"context_line":"    allocations \u003d create_allocation_list(context, data, consumers)"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    try:"},{"line_number":487,"context_line":"        allocations.create_all()"},{"line_number":488,"context_line":"        LOG.debug(\"Successfully wrote allocations %s\", allocations)"},{"line_number":489,"context_line":"    except exception.NotFound as exc:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_9c53bb6c","line":486,"updated":"2018-07-04 16:05:26.000000000","message":"see comment above","commit_id":"c19390e586858794f4a0bcfbe368ffaee2157d7e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f8c797240ebf454cfa85cbd8ccb6c604372cc56c","unresolved":false,"context_lines":[{"line_number":483,"context_line":"    # and consumer generations (if applicable) check all in one go."},{"line_number":484,"context_line":"    allocations \u003d create_allocation_list(context, data, consumers)"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    try:"},{"line_number":487,"context_line":"        allocations.create_all()"},{"line_number":488,"context_line":"        LOG.debug(\"Successfully wrote allocations %s\", allocations)"},{"line_number":489,"context_line":"    except exception.NotFound as exc:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_deb5951a","line":486,"in_reply_to":"5f7c97a3_9c53bb6c","updated":"2018-07-05 15:30:41.000000000","message":"Done","commit_id":"c19390e586858794f4a0bcfbe368ffaee2157d7e"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"e43c3a93f5439e8942e4b676ac14d2051122dd1d","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        project_id \u003d data[consumer_uuid][\u0027project_id\u0027]"},{"line_number":469,"context_line":"        user_id \u003d data[consumer_uuid][\u0027user_id\u0027]"},{"line_number":470,"context_line":"        consumer_generation \u003d data[consumer_uuid].get(\u0027consumer_generation\u0027)"},{"line_number":471,"context_line":"        consumer, new_consumer_created \u003d util.ensure_consumer("},{"line_number":472,"context_line":"            context, consumer_uuid, project_id, user_id, consumer_generation,"},{"line_number":473,"context_line":"            want_version)"},{"line_number":474,"context_line":"        if new_consumer_created:"},{"line_number":475,"context_line":"            new_consumers_created.append(consumer)"},{"line_number":476,"context_line":"        consumers[consumer_uuid] \u003d consumer"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_42918845","line":473,"range":{"start_line":471,"start_character":0,"end_line":473,"end_character":25},"updated":"2018-07-07 07:02:44.000000000","message":"If two consumers are provided and let\u0027s say the first one is created properly as a new Consumer and the second fails due to the generation mismatch, this results in HTTPConflict earlier here and the first one becomes a phantom, doesn\u0027t it?\n\nIf this is true, we should have _delete_consumers() here, too.","commit_id":"966082f063255ef138b6af7ffd9dfff9d4c465b2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9ea1f1e76fdd35cc203aad734ab7d049aa43958b","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        project_id \u003d data[consumer_uuid][\u0027project_id\u0027]"},{"line_number":469,"context_line":"        user_id \u003d data[consumer_uuid][\u0027user_id\u0027]"},{"line_number":470,"context_line":"        consumer_generation \u003d data[consumer_uuid].get(\u0027consumer_generation\u0027)"},{"line_number":471,"context_line":"        consumer, new_consumer_created \u003d util.ensure_consumer("},{"line_number":472,"context_line":"            context, consumer_uuid, project_id, user_id, consumer_generation,"},{"line_number":473,"context_line":"            want_version)"},{"line_number":474,"context_line":"        if new_consumer_created:"},{"line_number":475,"context_line":"            new_consumers_created.append(consumer)"},{"line_number":476,"context_line":"        consumers[consumer_uuid] \u003d consumer"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_7d72147e","line":473,"range":{"start_line":471,"start_character":0,"end_line":473,"end_character":25},"in_reply_to":"5f7c97a3_1a0766cb","updated":"2018-07-09 14:55:14.000000000","message":"Right but ensure_consumer() can raise HTTPConflict. If that happens on consumer 3 of the list, consumers 1 and 2 that you created already will be left in the database because you won\u0027t make it to L489 to clean them up.","commit_id":"966082f063255ef138b6af7ffd9dfff9d4c465b2"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"59351cb94c67940ee3865e0f0ac135ea40b65c25","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        project_id \u003d data[consumer_uuid][\u0027project_id\u0027]"},{"line_number":469,"context_line":"        user_id \u003d data[consumer_uuid][\u0027user_id\u0027]"},{"line_number":470,"context_line":"        consumer_generation \u003d data[consumer_uuid].get(\u0027consumer_generation\u0027)"},{"line_number":471,"context_line":"        consumer, new_consumer_created \u003d util.ensure_consumer("},{"line_number":472,"context_line":"            context, consumer_uuid, project_id, user_id, consumer_generation,"},{"line_number":473,"context_line":"            want_version)"},{"line_number":474,"context_line":"        if new_consumer_created:"},{"line_number":475,"context_line":"            new_consumers_created.append(consumer)"},{"line_number":476,"context_line":"        consumers[consumer_uuid] \u003d consumer"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_1a0766cb","line":473,"range":{"start_line":471,"start_character":0,"end_line":473,"end_character":25},"in_reply_to":"5f7c97a3_42918845","updated":"2018-07-09 14:09:33.000000000","message":"@tetsuro: we have the call to delete *all* consumers that were auto-created on line 489.","commit_id":"966082f063255ef138b6af7ffd9dfff9d4c465b2"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"513b2e383999e814a5bfe992686551c0f4d0d7a2","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        project_id \u003d data[consumer_uuid][\u0027project_id\u0027]"},{"line_number":469,"context_line":"        user_id \u003d data[consumer_uuid][\u0027user_id\u0027]"},{"line_number":470,"context_line":"        consumer_generation \u003d data[consumer_uuid].get(\u0027consumer_generation\u0027)"},{"line_number":471,"context_line":"        consumer, new_consumer_created \u003d util.ensure_consumer("},{"line_number":472,"context_line":"            context, consumer_uuid, project_id, user_id, consumer_generation,"},{"line_number":473,"context_line":"            want_version)"},{"line_number":474,"context_line":"        if new_consumer_created:"},{"line_number":475,"context_line":"            new_consumers_created.append(consumer)"},{"line_number":476,"context_line":"        consumers[consumer_uuid] \u003d consumer"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_9d07f01d","line":473,"range":{"start_line":471,"start_character":0,"end_line":473,"end_character":25},"in_reply_to":"5f7c97a3_7d72147e","updated":"2018-07-09 15:20:36.000000000","message":"Oh, I see. Yes. That\u0027s a latent bug. I suppose I can fix that up in this patch too.","commit_id":"966082f063255ef138b6af7ffd9dfff9d4c465b2"}],"nova/api/openstack/placement/objects/consumer.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"726382cb07075b8bab55f8cc61a6d8d273b4d517","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    \"\"\"Deletes the supplied consumer."},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    :param ctx: `nova.context.RequestContext` that contains an oslo_db Session"},{"line_number":138,"context_line":"    :param consumer: `Consumer` whose generation should be updated."},{"line_number":139,"context_line":"    \"\"\""},{"line_number":140,"context_line":"    del_stmt \u003d CONSUMER_TBL.delete().where(CONSUMER_TBL.c.id \u003d\u003d consumer.id)"},{"line_number":141,"context_line":"    ctx.session.execute(del_stmt)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_c8989fcd","line":138,"range":{"start_line":138,"start_character":32,"end_line":138,"end_character":67},"updated":"2018-07-03 20:49:32.000000000","message":"copy/paste error?","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f3387adea8bf6802b564144b3dbf9fe2167c5982","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    \"\"\"Deletes the supplied consumer."},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    :param ctx: `nova.context.RequestContext` that contains an oslo_db Session"},{"line_number":138,"context_line":"    :param consumer: `Consumer` whose generation should be updated."},{"line_number":139,"context_line":"    \"\"\""},{"line_number":140,"context_line":"    del_stmt \u003d CONSUMER_TBL.delete().where(CONSUMER_TBL.c.id \u003d\u003d consumer.id)"},{"line_number":141,"context_line":"    ctx.session.execute(del_stmt)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_a8fe8367","line":138,"range":{"start_line":138,"start_character":32,"end_line":138,"end_character":67},"in_reply_to":"5f7c97a3_c8989fcd","updated":"2018-07-03 21:23:59.000000000","message":"Done","commit_id":"3903d8f9a28d22385a0b577f46933285c7ffd6a3"}]}
