)]}'
{"nova/api/openstack/placement/handlers/allocation.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9f4405da1b0ed604a337cb12ff0e3007f8acb4ae","unresolved":false,"context_lines":[{"line_number":193,"context_line":"    return rp_obj.AllocationList(context, objects\u003dallocation_objects)"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"def inspect_consumers(context, data, want_version):"},{"line_number":197,"context_line":"    \"\"\"Look at consumer data in allocations and create consumers as needed."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    Keep a record of the consumers that are created in case they need"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_c8eba90e","line":196,"range":{"start_line":196,"start_character":4,"end_line":196,"end_character":21},"updated":"2018-07-17 16:36:05.000000000","message":"ack, nice cleanup moving this to its own func","commit_id":"84536063adf5f0f80de2eb38af5a45219245f228"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3913600ef396ea7937f90be6d73dbb6317d0a8e6","unresolved":false,"context_lines":[{"line_number":218,"context_line":"    for consumer_uuid in data:"},{"line_number":219,"context_line":"        project_id \u003d data[consumer_uuid][\u0027project_id\u0027]"},{"line_number":220,"context_line":"        user_id \u003d data[consumer_uuid][\u0027user_id\u0027]"},{"line_number":221,"context_line":"        consumer_generation \u003d data[consumer_uuid].get(\u0027consumer_generation\u0027)"},{"line_number":222,"context_line":"        try:"},{"line_number":223,"context_line":"            consumer, new_consumer_created \u003d util.ensure_consumer("},{"line_number":224,"context_line":"                context, consumer_uuid, project_id, user_id,"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_55d96325","line":221,"updated":"2018-07-18 08:38:59.000000000","message":"Even if this is a new consumer the API version \u003e\u003d 1.28 should enforces that it has consumer_generation\u003dNone set in the request so you can use data[consumer_uuid][\u0027consumer_generation\u0027] freely. Spec also shows the allocation with project/user_id and consumer_generation set in the request[1]. Or did I missed something?\n\n[1]https://review.openstack.org/#/c/572583/11/specs/rocky/approved/reshape-provider-tree.rst@172\n\n-- later --\nNow I see that it is pulled out from set_allocations() and reused therefore it needs to handle older than version 1.28 calls. So this is OK as is.","commit_id":"e708cd259d2af7debad8453e9a821c0d659dc0ef"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    :param context: The placement context."},{"line_number":208,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":209,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":210,"context_line":"             and a list of those consumer objects which are new."},{"line_number":211,"context_line":"    :raises: webob.exc.HTTPConflict"},{"line_number":212,"context_line":"    \"\"\""},{"line_number":213,"context_line":"    # First, ensure that all consumers referenced in the payload actually"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_925c9b1a","line":210,"range":{"start_line":209,"start_character":0,"end_line":210,"end_character":64},"updated":"2018-07-21 15:51:24.000000000","message":"are we on a namedtuple kick?","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"073289ef45452a61489ef766dc01b2f14b1ce09c","unresolved":false,"context_lines":[{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    :param context: The placement context."},{"line_number":208,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":209,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":210,"context_line":"             and a list of those consumer objects which are new."},{"line_number":211,"context_line":"    :raises: webob.exc.HTTPConflict"},{"line_number":212,"context_line":"    \"\"\""},{"line_number":213,"context_line":"    # First, ensure that all consumers referenced in the payload actually"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_b2e4370c","line":210,"range":{"start_line":209,"start_character":0,"end_line":210,"end_character":64},"in_reply_to":"5f7c97a3_925c9b1a","updated":"2018-07-21 16:29:11.000000000","message":"this is a straight cut and paste of the original code, extracted to a method. I\u0027d rather change things about in a different patch","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d7334c7d1b19d54f3638bfed0196dc8af7499b31","unresolved":false,"context_lines":[{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    :param context: The placement context."},{"line_number":208,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":209,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":210,"context_line":"             and a list of those consumer objects which are new."},{"line_number":211,"context_line":"    :raises: webob.exc.HTTPConflict"},{"line_number":212,"context_line":"    \"\"\""},{"line_number":213,"context_line":"    # First, ensure that all consumers referenced in the payload actually"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_b243d796","line":210,"range":{"start_line":209,"start_character":0,"end_line":210,"end_character":64},"in_reply_to":"5f7c97a3_b2e4370c","updated":"2018-07-21 17:37:44.000000000","message":"okay (here and below)","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":209,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":210,"context_line":"             and a list of those consumer objects which are new."},{"line_number":211,"context_line":"    :raises: webob.exc.HTTPConflict"},{"line_number":212,"context_line":"    \"\"\""},{"line_number":213,"context_line":"    # First, ensure that all consumers referenced in the payload actually"},{"line_number":214,"context_line":"    # exist. And if not, create them. Keep a record of auto-created consumers"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_d2abf3d3","line":211,"range":{"start_line":211,"start_character":23,"end_line":211,"end_character":35},"updated":"2018-07-21 15:51:24.000000000","message":"This doesn\u0027t match L229.","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d7334c7d1b19d54f3638bfed0196dc8af7499b31","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":209,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":210,"context_line":"             and a list of those consumer objects which are new."},{"line_number":211,"context_line":"    :raises: webob.exc.HTTPConflict"},{"line_number":212,"context_line":"    \"\"\""},{"line_number":213,"context_line":"    # First, ensure that all consumers referenced in the payload actually"},{"line_number":214,"context_line":"    # exist. And if not, create them. Keep a record of auto-created consumers"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_f24dcfc4","line":211,"range":{"start_line":211,"start_character":23,"end_line":211,"end_character":35},"in_reply_to":"5f7c97a3_52b923e9","updated":"2018-07-21 17:37:44.000000000","message":"Cool with me, but it would thus probably be better if L229 captured HTTPConflict instead of Exception.","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"073289ef45452a61489ef766dc01b2f14b1ce09c","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":209,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":210,"context_line":"             and a list of those consumer objects which are new."},{"line_number":211,"context_line":"    :raises: webob.exc.HTTPConflict"},{"line_number":212,"context_line":"    \"\"\""},{"line_number":213,"context_line":"    # First, ensure that all consumers referenced in the payload actually"},{"line_number":214,"context_line":"    # exist. And if not, create them. Keep a record of auto-created consumers"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_52b923e9","line":211,"range":{"start_line":211,"start_character":23,"end_line":211,"end_character":35},"in_reply_to":"5f7c97a3_d2abf3d3","updated":"2018-07-21 16:29:11.000000000","message":"ensure_consumer will commonly raise HTTPConflict so I wanted to capture that","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b4eec1e50e9aeec041cbbf8061573561cbbc7a9d","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":209,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":210,"context_line":"             and a list of those consumer objects which are new."},{"line_number":211,"context_line":"    :raises: webob.exc.HTTPConflict"},{"line_number":212,"context_line":"    \"\"\""},{"line_number":213,"context_line":"    # First, ensure that all consumers referenced in the payload actually"},{"line_number":214,"context_line":"    # exist. And if not, create them. Keep a record of auto-created consumers"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_f8a7ed50","line":211,"range":{"start_line":211,"start_character":23,"end_line":211,"end_character":35},"in_reply_to":"5f7c97a3_f24dcfc4","updated":"2018-07-22 11:51:13.000000000","message":"It also needs to deal with the fact that it could raise various database problems and a variety of exceptions we aren\u0027t thinking of now. It\u0027s a catch-all: in all cases we need delete_consumers to happen, not just HTTPConflict\n\nSo, while HTTPConflict is the common case it\u0027s not the only one. If it makes you feel better we could change the doc string to say \"could raise all kinds of stuff, we dunno\". Which would you prefer?","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6abf6e6710f03b5a7df739c4fa4df5bda7474eab","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":209,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":210,"context_line":"             and a list of those consumer objects which are new."},{"line_number":211,"context_line":"    :raises: webob.exc.HTTPConflict"},{"line_number":212,"context_line":"    \"\"\""},{"line_number":213,"context_line":"    # First, ensure that all consumers referenced in the payload actually"},{"line_number":214,"context_line":"    # exist. And if not, create them. Keep a record of auto-created consumers"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_3b555ffa","line":211,"range":{"start_line":211,"start_character":23,"end_line":211,"end_character":35},"in_reply_to":"5f7c97a3_f8a7ed50","updated":"2018-07-22 12:32:42.000000000","message":"Yeah, \"...and other exceptions from database errors, sunspots, etc.\" kind of thing would be fine. Would those result in a generic 400? 500?","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            # If any errors (for instance, a consumer generation conflict)"},{"line_number":231,"context_line":"            # occur when ensuring consumer records above, make sure we delete"},{"line_number":232,"context_line":"            # any auto-created consumers."},{"line_number":233,"context_line":"            delete_consumers(new_consumers_created)"},{"line_number":234,"context_line":"            raise"},{"line_number":235,"context_line":"    return consumers, new_consumers_created"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_92b1fb47","line":233,"range":{"start_line":233,"start_character":12,"end_line":233,"end_character":28},"updated":"2018-07-21 15:51:24.000000000","message":"and what if this guy raises.\n\nWe need to use save_and_reraise_exception here.\n\n(Recognizing this is a cut/paste from below)","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"073289ef45452a61489ef766dc01b2f14b1ce09c","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            # If any errors (for instance, a consumer generation conflict)"},{"line_number":231,"context_line":"            # occur when ensuring consumer records above, make sure we delete"},{"line_number":232,"context_line":"            # any auto-created consumers."},{"line_number":233,"context_line":"            delete_consumers(new_consumers_created)"},{"line_number":234,"context_line":"            raise"},{"line_number":235,"context_line":"    return consumers, new_consumers_created"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_72bc5fda","line":233,"range":{"start_line":233,"start_character":12,"end_line":233,"end_character":28},"in_reply_to":"5f7c97a3_92b1fb47","updated":"2018-07-21 16:29:11.000000000","message":"probably, but see above","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f21ce59940731b579c02da83ae685e6c5957da82","unresolved":false,"context_lines":[{"line_number":233,"context_line":"            # any auto-created consumers."},{"line_number":234,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":235,"context_line":"                delete_consumers(new_consumers_created)"},{"line_number":236,"context_line":"    return consumers, new_consumers_created"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"@wsgi_wrapper.PlacementWsgify"}],"source_content_type":"text/x-python","patch_set":23,"id":"5f7c97a3_2e0f722f","line":236,"updated":"2018-08-01 18:49:35.000000000","message":"this is great cleanup, but you can probably do it in a separate patch. :)","commit_id":"323738628ae83b77fcf9b3db658e6e020e748637"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8801285f7d0a7579ce53a58efd98a81a46b4ff4d","unresolved":false,"context_lines":[{"line_number":233,"context_line":"            # any auto-created consumers."},{"line_number":234,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":235,"context_line":"                delete_consumers(new_consumers_created)"},{"line_number":236,"context_line":"    return consumers, new_consumers_created"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"@wsgi_wrapper.PlacementWsgify"}],"source_content_type":"text/x-python","patch_set":23,"id":"5f7c97a3_7f5c35ef","line":236,"in_reply_to":"5f7c97a3_2e0f722f","updated":"2018-08-01 21:17:50.000000000","message":"I needed it for the main change, probably should have done it in a change before this one, but at the time we were rushing. Now... we probably got time now if it matters.","commit_id":"323738628ae83b77fcf9b3db658e6e020e748637"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"97a5f94b503941cb151879c0c407e91fa0543b30","unresolved":false,"context_lines":[{"line_number":207,"context_line":"    exception reraised to the caller."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    :param context: The placement context."},{"line_number":210,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":211,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":212,"context_line":"             and a list of those consumer objects which are new."},{"line_number":213,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":24,"id":"5f7c97a3_a865acb1","line":210,"updated":"2018-08-02 09:03:35.000000000","message":"nit: missing doc for want_version","commit_id":"262e881f24732bb3f9952d8d1d2def2778dfc890"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a02a227c221c87bc47d2d9c6f3347536872200cc","unresolved":false,"context_lines":[{"line_number":207,"context_line":"    exception reraised to the caller."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    :param context: The placement context."},{"line_number":210,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":211,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":212,"context_line":"             and a list of those consumer objects which are new."},{"line_number":213,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":24,"id":"3f79a3b5_af178945","line":210,"in_reply_to":"5f7c97a3_a865acb1","updated":"2018-08-21 17:15:20.000000000","message":"Done","commit_id":"262e881f24732bb3f9952d8d1d2def2778dfc890"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3da6ec0bbf6c05a57f4afc80a6a0cd241ad3e328","unresolved":false,"context_lines":[{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    :param context: The placement context."},{"line_number":210,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":211,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":212,"context_line":"             and a list of those consumer objects which are new."},{"line_number":213,"context_line":"    \"\"\""},{"line_number":214,"context_line":"    # First, ensure that all consumers referenced in the payload actually"}],"source_content_type":"text/x-python","patch_set":27,"id":"3f79a3b5_5ad987f0","line":211,"updated":"2018-08-13 13:46:27.000000000","message":"nit: missing doc for want_version","commit_id":"9530c9af44406f37599e2b5b76f78bfdb8af116d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a02a227c221c87bc47d2d9c6f3347536872200cc","unresolved":false,"context_lines":[{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    :param context: The placement context."},{"line_number":210,"context_line":"    :param data: A dictionary of multiple allocations by consumer uuid."},{"line_number":211,"context_line":"    :return: A tuple of a dict of all consumer objects (by consumer uuid)"},{"line_number":212,"context_line":"             and a list of those consumer objects which are new."},{"line_number":213,"context_line":"    \"\"\""},{"line_number":214,"context_line":"    # First, ensure that all consumers referenced in the payload actually"}],"source_content_type":"text/x-python","patch_set":27,"id":"3f79a3b5_4fb835c7","line":211,"in_reply_to":"3f79a3b5_5ad987f0","updated":"2018-08-21 17:15:20.000000000","message":"Done","commit_id":"9530c9af44406f37599e2b5b76f78bfdb8af116d"}],"nova/api/openstack/placement/handlers/reshaper.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d4a74b5ab43e406b669159e6793e17edd44afd1b","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    # TODO(cdent): Create various objects and wire up to the object backend for"},{"line_number":35,"context_line":"    # storage. 409 on generation conflicts, 400 on other stuff."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    # FIXME(cdent): normally 204"},{"line_number":38,"context_line":"    req.response.status \u003d 200"},{"line_number":39,"context_line":"    req.response.content_type \u003d \u0027application/json\u0027"},{"line_number":40,"context_line":"    req.response.body \u003d jsonutils.dumps(data[\u0027inventories\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_857e1219","line":37,"range":{"start_line":37,"start_character":29,"end_line":37,"end_character":32},"updated":"2018-06-20 21:27:41.000000000","message":"Hm, is that what we said?\n\nDangit, yeah [1].  It\u0027s going to suck having to get new generations for everything.  Can we change our mind and return what amounts to the same payload, but with the generations updated?\n\n[1] http://specs.openstack.org/openstack/nova-specs/specs/rocky/approved/reshape-provider-tree.html#placement-post-reshaper","commit_id":"d9b52e381f3b68b0ce3c75913dc23d5b6eb05e9f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2257cc4b0043c842eb2942386f5763e46914ca2d","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    # TODO(cdent): Create various objects and wire up to the object backend for"},{"line_number":35,"context_line":"    # storage. 409 on generation conflicts, 400 on other stuff."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    # FIXME(cdent): normally 204"},{"line_number":38,"context_line":"    req.response.status \u003d 200"},{"line_number":39,"context_line":"    req.response.content_type \u003d \u0027application/json\u0027"},{"line_number":40,"context_line":"    req.response.body \u003d jsonutils.dumps(data[\u0027inventories\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_79a4b1a3","line":37,"range":{"start_line":37,"start_character":29,"end_line":37,"end_character":32},"in_reply_to":"5f7c97a3_117a3f87","updated":"2018-06-21 15:23:06.000000000","message":"I\u0027m just thinking of the flow in update_from_provider_tree.  There\u0027s housekeeping to be done after POST /reshaper that will require updated provider generations.  And we\u0027ll at least have to invalidate the cache for any provider not touched in that phase, so we don\u0027t wind up with a stale generation on the next periodic.\n\nWhich sucks worse than if we could just peel the updated generations out of the response payload.","commit_id":"d9b52e381f3b68b0ce3c75913dc23d5b6eb05e9f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3bf3d48c94b9eef789a084e14c339b4268ba8edb","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    # TODO(cdent): Create various objects and wire up to the object backend for"},{"line_number":35,"context_line":"    # storage. 409 on generation conflicts, 400 on other stuff."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    # FIXME(cdent): normally 204"},{"line_number":38,"context_line":"    req.response.status \u003d 200"},{"line_number":39,"context_line":"    req.response.content_type \u003d \u0027application/json\u0027"},{"line_number":40,"context_line":"    req.response.body \u003d jsonutils.dumps(data[\u0027inventories\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_117a3f87","line":37,"range":{"start_line":37,"start_character":29,"end_line":37,"end_character":32},"in_reply_to":"5f7c97a3_857e1219","updated":"2018-06-21 08:35:48.000000000","message":"I\u0027m not clear on why we would want do that. Using the /reshaper is an exceptional thing, after which it makes sense (to me) to restart the provider tree from scratch.\n\nBeyond that: It doesn\u0027t suck having to get new stuff. It\u0027s clean and simple and tidy and just the way it works.","commit_id":"d9b52e381f3b68b0ce3c75913dc23d5b6eb05e9f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4dab98afad899e78ff73fea40609bb3621c0e719","unresolved":false,"context_lines":[{"line_number":75,"context_line":"            inv_list.append(inv_obj)"},{"line_number":76,"context_line":"        inventory_by_rp[rp_uuid] \u003d rp_obj.InventoryList(objects\u003dinv_list)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    allocation_objects \u003d allocation.create_allocation_list("},{"line_number":79,"context_line":"        context, allocations, want_version)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    # TODO(cdent): When the real thing exists, call it here."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_1e5b0d54","line":78,"range":{"start_line":78,"start_character":4,"end_line":78,"end_character":22},"updated":"2018-06-22 14:10:23.000000000","message":"This is your pep failure.  Did you mean to shove this into the resp?","commit_id":"97e4e6e54d9852e0150f63ddb895d04f54afa2c3"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cd845395c25ebfc4bdf979f9cc98a476e0c073ac","unresolved":false,"context_lines":[{"line_number":75,"context_line":"            inv_list.append(inv_obj)"},{"line_number":76,"context_line":"        inventory_by_rp[rp_uuid] \u003d rp_obj.InventoryList(objects\u003dinv_list)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    allocation_objects \u003d allocation.create_allocation_list("},{"line_number":79,"context_line":"        context, allocations, want_version)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    # TODO(cdent): When the real thing exists, call it here."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_b2dd6d6e","line":78,"range":{"start_line":78,"start_character":4,"end_line":78,"end_character":22},"in_reply_to":"5f7c97a3_1e5b0d54","updated":"2018-06-27 09:50:34.000000000","message":"I did not, I mean to shove it into rp_obj.reshape when that exists (I got the name wrong in the commented thing below). I intend to maintain the empty response.\n\nThe pep8 failure was expected and intentional as part of the \"this ain\u0027t done yet\".","commit_id":"97e4e6e54d9852e0150f63ddb895d04f54afa2c3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9fcf1339679ac6b9353d0db9ea0a61284684d3fc","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from nova.api.openstack.placement import errors"},{"line_number":22,"context_line":"from nova.api.openstack.placement import exception"},{"line_number":23,"context_line":"# TODO(cdent): That we are doing this suggests that there\u0027s stuff to be"},{"line_number":24,"context_line":"# extracted from the handler to a shared module."},{"line_number":25,"context_line":"from nova.api.openstack.placement.handlers import allocation"},{"line_number":26,"context_line":"from nova.api.openstack.placement.handlers import inventory"},{"line_number":27,"context_line":"from nova.api.openstack.placement import microversion"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_1ffe0606","line":24,"updated":"2018-07-13 13:39:19.000000000","message":"++\n\nI have a series of cleanups for this kind of code along with splitting the giant resource_provider.py object file.","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"72d70d265de6128edfa92fb7c0094bbd5c8fa541","unresolved":false,"context_lines":[{"line_number":75,"context_line":"            inv_list.append(inv_obj)"},{"line_number":76,"context_line":"        inventory_by_rp[rp_uuid] \u003d rp_obj.InventoryList(objects\u003dinv_list)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    # TODO(efried): This broke on the rebase (third arg now needs to be a dict"},{"line_number":79,"context_line":"    # of consumers) and I ran out of time to figure out how to fix it."},{"line_number":80,"context_line":"    allocation_objects \u003d allocation.create_allocation_list("},{"line_number":81,"context_line":"        context, allocations, want_version)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    rp_obj.reshape(inventory_by_rp, allocation_objects)"},{"line_number":84,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_406b32ef","line":81,"range":{"start_line":78,"start_character":0,"end_line":81,"end_character":43},"updated":"2018-07-13 22:34:50.000000000","message":"Broke this on the rebase, ran out of time to fix it tonight. Not sure what the resolution should be. Ensuring consumers at this stage, probably, duplicating the code in set_allocations. Or perhaps reshaper should accept the dict rather than AllocationList, and do that itself?","commit_id":"e2ea0d3e0dd038f1d7c0b889ce788c1dfc069b50"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"bbcc3dcc081d60171b6cd6242e019ff354cb4ad1","unresolved":false,"context_lines":[{"line_number":75,"context_line":"            inv_list.append(inv_obj)"},{"line_number":76,"context_line":"        inventory_by_rp[rp_uuid] \u003d rp_obj.InventoryList(objects\u003dinv_list)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    # TODO(efried): This broke on the rebase (third arg now needs to be a dict"},{"line_number":79,"context_line":"    # of consumers) and I ran out of time to figure out how to fix it."},{"line_number":80,"context_line":"    allocation_objects \u003d allocation.create_allocation_list("},{"line_number":81,"context_line":"        context, allocations, want_version)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    rp_obj.reshape(inventory_by_rp, allocation_objects)"},{"line_number":84,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_f90f8636","line":81,"range":{"start_line":78,"start_character":0,"end_line":81,"end_character":43},"in_reply_to":"5f7c97a3_406b32ef","updated":"2018-07-16 09:52:20.000000000","message":"I\u0027ll mess with this and see what I can do. Duplicating the code is the most direct way for now, I reckon.","commit_id":"e2ea0d3e0dd038f1d7c0b889ce788c1dfc069b50"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2914e3608f0baee59a37a5c6a43b4a41f698650c","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    try:"},{"line_number":86,"context_line":"        rp_obj.reshape(context, inventory_by_rp, allocation_objects)"},{"line_number":87,"context_line":"    except Exception:"},{"line_number":88,"context_line":"        allocation.delete_consumers(new_consumers_created)"},{"line_number":89,"context_line":"        raise"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    req.response.status \u003d 204"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_528d307a","line":88,"updated":"2018-07-18 13:22:35.000000000","message":"Do we need save_and_reraise_exception here? (I saw a couple of other places that might could use it.) Or is it okay because we don\u0027t actually care about the stack trace, we just convert it to an appropriate HTTP exception?","commit_id":"3668429d7c5d093b67110f3cb8f7864389f2c6cd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"33822f3ff0959d70d0262372dbf69e53946c8f77","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    try:"},{"line_number":86,"context_line":"        rp_obj.reshape(context, inventory_by_rp, allocation_objects)"},{"line_number":87,"context_line":"    except Exception:"},{"line_number":88,"context_line":"        allocation.delete_consumers(new_consumers_created)"},{"line_number":89,"context_line":"        raise"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    req.response.status \u003d 204"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_9e213352","line":88,"in_reply_to":"5f7c97a3_17f3ea6e","updated":"2018-07-19 15:11:23.000000000","message":"It be like\n\n from oslo_utils import excutils\n ...\n\n except Exception:\n     with excutils.save_and_reraise_exception():\n         allocation.delete_consumers(new_consumers_created)\n         # and the \u0027raise\u0027 is implicit\n\nIf you need to reraise conditionally, it be like\n\n except Exception:\n     with excutils.save_and_reraise_exception() as sare:\n         if this_is_expected:\n             sare.reraise \u003d False\n             ...","commit_id":"3668429d7c5d093b67110f3cb8f7864389f2c6cd"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"9f0516806d846b34a3b9c89553207446d65533cf","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    try:"},{"line_number":86,"context_line":"        rp_obj.reshape(context, inventory_by_rp, allocation_objects)"},{"line_number":87,"context_line":"    except Exception:"},{"line_number":88,"context_line":"        allocation.delete_consumers(new_consumers_created)"},{"line_number":89,"context_line":"        raise"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    req.response.status \u003d 204"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_17f3ea6e","line":88,"in_reply_to":"5f7c97a3_528d307a","updated":"2018-07-18 13:28:47.000000000","message":"That\u0027s a good point. I\u0027m not sure of the details of how all that works, but you\u0027re probably right.","commit_id":"3668429d7c5d093b67110f3cb8f7864389f2c6cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9f4405da1b0ed604a337cb12ff0e3007f8acb4ae","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":"\"\"\"Placement API handler for the reshaper."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Reshaping is. TODO(cdent)."},{"line_number":15,"context_line":"\"\"\""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import copy"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_2839fda1","line":14,"range":{"start_line":14,"start_character":0,"end_line":14,"end_character":26},"updated":"2018-07-17 16:36:05.000000000","message":"is it still? looks like you\u0027ve linked in the call to rp_obj.reshape() properly...","commit_id":"84536063adf5f0f80de2eb38af5a45219245f228"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"20d3b5ddc75026ec4481bc2022267dbdca49428d","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":"\"\"\"Placement API handler for the reshaper."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Reshaping is. TODO(cdent)."},{"line_number":15,"context_line":"\"\"\""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import copy"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_48523938","line":14,"range":{"start_line":14,"start_character":0,"end_line":14,"end_character":26},"in_reply_to":"5f7c97a3_2839fda1","updated":"2018-07-17 16:42:11.000000000","message":"At the time I wrote this I didn\u0027t have a good description of what it was. Eric gave me one when he commented on the microversion history, so I\u0027ll stick that in here too.","commit_id":"84536063adf5f0f80de2eb38af5a45219245f228"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3913600ef396ea7937f90be6d73dbb6317d0a8e6","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    consumers, new_consumers_created \u003d allocation.inspect_consumers("},{"line_number":80,"context_line":"        context, allocations, want_version)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    allocation_objects \u003d allocation.create_allocation_list("},{"line_number":83,"context_line":"        context, allocations, consumers)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_924071a5","line":82,"updated":"2018-07-18 08:38:59.000000000","message":"This could potentially read different RP data (with different generation) from the database than what was read at L54 and used for the inventories. Then the reshape call will update the RP inventories that bumps the generations of the RPs then the new RP state is blindly set to the allocation objects then allocations are updated.\n\n1) invRP.gen \u003d 1   #L54\n2) allocRP.gen \u003d 2  #L82 as in the meantime somebody updated the RP in a parallel request\n3) reshape tries to update the inventory of invRP(gen\u003d1) but DB has gen\u003d\u003d2 so that fails. So reshape() will never reach the point when allocRP is blindly overwritten.\n\nSo I think we are safe. :)","commit_id":"e708cd259d2af7debad8453e9a821c0d659dc0ef"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2914e3608f0baee59a37a5c6a43b4a41f698650c","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    consumers, new_consumers_created \u003d allocation.inspect_consumers("},{"line_number":80,"context_line":"        context, allocations, want_version)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    allocation_objects \u003d allocation.create_allocation_list("},{"line_number":83,"context_line":"        context, allocations, consumers)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_b727961e","line":82,"in_reply_to":"5f7c97a3_924071a5","updated":"2018-07-18 13:22:35.000000000","message":"I also brought up in IRC yesterday that the user could send in a payload where the RP generations on the allocations side differ from those on the inventory side. It was decided that we would ignore such a discrepancy and treat the inventory side as definitive. That\u0027s what happens when we overwrite the RPs in the AllocationList (in the db-side code), never having used them or looked at them up to that point.","commit_id":"e708cd259d2af7debad8453e9a821c0d659dc0ef"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"33822f3ff0959d70d0262372dbf69e53946c8f77","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        context, allocations, want_version)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    # NOTE(cdent): When these allocations are created they get resource"},{"line_number":86,"context_line":"    # provider objects which are different from those loaded above when"},{"line_number":87,"context_line":"    # creating inventory objects. The reshape method below is reponsible"},{"line_number":88,"context_line":"    # for ensuring that the resource providers and their generations do"},{"line_number":89,"context_line":"    # not conflict."}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_97e7faab","line":86,"range":{"start_line":86,"start_character":23,"end_line":86,"end_character":42},"updated":"2018-07-19 15:11:23.000000000","message":"This is slightly confusing. The objects don\u0027t actually differ (unless some async transaction completed since the loop on L73) - rather, they\u0027re different instances of the *same* objects with (usually) the same data.\n\nIt\u0027s anal, I know, but this is a confusing thing that future us will thank present us for wording as clearly as possible.","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e119e1bff2fc3839ace30407ac464836ca322c00","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        context, allocations, want_version)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    # NOTE(cdent): When these allocations are created they get resource"},{"line_number":86,"context_line":"    # provider objects which are different from those loaded above when"},{"line_number":87,"context_line":"    # creating inventory objects. The reshape method below is reponsible"},{"line_number":88,"context_line":"    # for ensuring that the resource providers and their generations do"},{"line_number":89,"context_line":"    # not conflict."}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_9d7362b4","line":86,"range":{"start_line":86,"start_character":23,"end_line":86,"end_character":42},"in_reply_to":"5f7c97a3_64e841a6","updated":"2018-07-20 10:46:01.000000000","message":"Done","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"1eff2fb034d1cc00840ad724b7d21c048de74509","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        context, allocations, want_version)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    # NOTE(cdent): When these allocations are created they get resource"},{"line_number":86,"context_line":"    # provider objects which are different from those loaded above when"},{"line_number":87,"context_line":"    # creating inventory objects. The reshape method below is reponsible"},{"line_number":88,"context_line":"    # for ensuring that the resource providers and their generations do"},{"line_number":89,"context_line":"    # not conflict."}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_64e841a6","line":86,"range":{"start_line":86,"start_character":23,"end_line":86,"end_character":42},"in_reply_to":"5f7c97a3_97e7faab","updated":"2018-07-19 20:01:31.000000000","message":"to be even more anal: if they are different instances of an object, they are not the same object.\n\nI\u0027ll clean it up.","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"fa255eca689bacdb65a53da8c54c04b41145ff95","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    # NOTE(cdent): When these allocations are created they get resource"},{"line_number":86,"context_line":"    # provider objects which are different from those loaded above when"},{"line_number":87,"context_line":"    # creating inventory objects. The reshape method below is reponsible"},{"line_number":88,"context_line":"    # for ensuring that the resource providers and their generations do"},{"line_number":89,"context_line":"    # not conflict."},{"line_number":90,"context_line":"    allocation_objects \u003d allocation.create_allocation_list("}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_ad589556","line":87,"range":{"start_line":87,"start_character":62,"end_line":87,"end_character":72},"updated":"2018-07-19 03:02:07.000000000","message":"responsible?","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e119e1bff2fc3839ace30407ac464836ca322c00","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    # NOTE(cdent): When these allocations are created they get resource"},{"line_number":86,"context_line":"    # provider objects which are different from those loaded above when"},{"line_number":87,"context_line":"    # creating inventory objects. The reshape method below is reponsible"},{"line_number":88,"context_line":"    # for ensuring that the resource providers and their generations do"},{"line_number":89,"context_line":"    # not conflict."},{"line_number":90,"context_line":"    allocation_objects \u003d allocation.create_allocation_list("}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_1d3992d6","line":87,"range":{"start_line":87,"start_character":62,"end_line":87,"end_character":72},"in_reply_to":"5f7c97a3_ad589556","updated":"2018-07-20 10:46:01.000000000","message":"Done","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f4a8e274803c322b8510c77a9e27204b88dd4195","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            rp_obj.reshape(context, inventory_by_rp, allocation_objects)"},{"line_number":96,"context_line":"        except Exception:"},{"line_number":97,"context_line":"            allocation.delete_consumers(new_consumers_created)"},{"line_number":98,"context_line":"            raise"},{"line_number":99,"context_line":"    # Distinguish inventory in use (has allocations on it)..."},{"line_number":100,"context_line":"    except exception.InventoryInUse as exc:"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_998716b4","line":97,"updated":"2018-07-19 09:48:38.000000000","message":"reminder that a save and reraise is needed here","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e24b5125b951459508055ef1719af80159edaf03","unresolved":false,"context_lines":[{"line_number":43,"context_line":"def reshape(req):"},{"line_number":44,"context_line":"    context \u003d req.environ[\u0027placement.context\u0027]"},{"line_number":45,"context_line":"    want_version \u003d req.environ[microversion.MICROVERSION_ENVIRON]"},{"line_number":46,"context_line":"    # TODO(cdent): just leaving this here as a marker for now"},{"line_number":47,"context_line":"    # context.can(policies.CREATE)"},{"line_number":48,"context_line":"    data \u003d util.extract_json(req.body, schema.POST_RESHAPER_SCHEMA)"},{"line_number":49,"context_line":"    inventories \u003d data[\u0027inventories\u0027]"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_a49e4366","line":46,"updated":"2018-07-20 14:32:52.000000000","message":"Should we make this go now or later? If we leave as is, it defaults to the simple \"must be admin\" default.","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":43,"context_line":"def reshape(req):"},{"line_number":44,"context_line":"    context \u003d req.environ[\u0027placement.context\u0027]"},{"line_number":45,"context_line":"    want_version \u003d req.environ[microversion.MICROVERSION_ENVIRON]"},{"line_number":46,"context_line":"    # TODO(cdent): just leaving this here as a marker for now"},{"line_number":47,"context_line":"    # context.can(policies.CREATE)"},{"line_number":48,"context_line":"    data \u003d util.extract_json(req.body, schema.POST_RESHAPER_SCHEMA)"},{"line_number":49,"context_line":"    inventories \u003d data[\u0027inventories\u0027]"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_b2851755","line":46,"in_reply_to":"5f7c97a3_a49e4366","updated":"2018-07-21 15:51:24.000000000","message":"admin-only seems reasonable to me for this operation. I\u0027m green about policy stuff, but is there a way to make that explicit here?","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        generation \u003d inventory_data[\u0027resource_provider_generation\u0027]"},{"line_number":68,"context_line":"        if generation !\u003d resource_provider.generation:"},{"line_number":69,"context_line":"            raise webob.exc.HTTPConflict("},{"line_number":70,"context_line":"                _(\u0027resource provider generation conflict\u0027),"},{"line_number":71,"context_line":"                comment\u003derrors.CONCURRENT_UPDATE)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        inv_list \u003d []"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_d294538e","line":70,"range":{"start_line":70,"start_character":19,"end_line":70,"end_character":56},"updated":"2018-07-21 15:51:24.000000000","message":"It would be helpful for debugging if this mentioned which RP and what the expected \u0026 actual generations were.","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"073289ef45452a61489ef766dc01b2f14b1ce09c","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        generation \u003d inventory_data[\u0027resource_provider_generation\u0027]"},{"line_number":68,"context_line":"        if generation !\u003d resource_provider.generation:"},{"line_number":69,"context_line":"            raise webob.exc.HTTPConflict("},{"line_number":70,"context_line":"                _(\u0027resource provider generation conflict\u0027),"},{"line_number":71,"context_line":"                comment\u003derrors.CONCURRENT_UPDATE)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        inv_list \u003d []"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_32b26706","line":70,"range":{"start_line":70,"start_character":19,"end_line":70,"end_character":56},"in_reply_to":"5f7c97a3_d294538e","updated":"2018-07-21 16:29:11.000000000","message":"aye","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    consumers, new_consumers_created \u003d allocation.inspect_consumers("},{"line_number":84,"context_line":"        context, allocations, want_version)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    # NOTE(cdent): When these allocations are created they get resource"},{"line_number":87,"context_line":"    # provider objects which are different instances (usually with the same"},{"line_number":88,"context_line":"    # data) from those loaded above when creating inventory objects. The"},{"line_number":89,"context_line":"    # reshape method below is responsible for ensuring that the resource"},{"line_number":90,"context_line":"    # providers and their generations do not conflict."},{"line_number":91,"context_line":"    allocation_objects \u003d allocation.create_allocation_list("},{"line_number":92,"context_line":"        context, allocations, consumers)"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_72e9bf16","line":90,"range":{"start_line":86,"start_character":0,"end_line":90,"end_character":54},"updated":"2018-07-21 15:51:24.000000000","message":"++","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"99708dcaeaac0216755b842c14b1378d2a9673f3","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                context, rp_uuid)"},{"line_number":62,"context_line":"        except exception.NotFound as exc:"},{"line_number":63,"context_line":"            raise webob.exc.HTTPBadRequest("},{"line_number":64,"context_line":"                _(\u0027Unfound resource provider %(rp_uuid)s in inventories: \u0027"},{"line_number":65,"context_line":"                  \u0027%(error)s\u0027) % {\u0027rp_uuid\u0027: rp_uuid, \u0027error\u0027: exc},"},{"line_number":66,"context_line":"                comment\u003derrors.RESOURCE_PROVIDER_NOT_FOUND)"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_a3fff867","line":64,"range":{"start_line":64,"start_character":19,"end_line":64,"end_character":26},"updated":"2018-07-23 12:26:45.000000000","message":"is this a proper word?","commit_id":"60b0c28d49118ba6b0cd0d567baac5521015c686"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"612183e04b20e01c2177a0a36dd486be812d4900","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                context, rp_uuid)"},{"line_number":62,"context_line":"        except exception.NotFound as exc:"},{"line_number":63,"context_line":"            raise webob.exc.HTTPBadRequest("},{"line_number":64,"context_line":"                _(\u0027Unfound resource provider %(rp_uuid)s in inventories: \u0027"},{"line_number":65,"context_line":"                  \u0027%(error)s\u0027) % {\u0027rp_uuid\u0027: rp_uuid, \u0027error\u0027: exc},"},{"line_number":66,"context_line":"                comment\u003derrors.RESOURCE_PROVIDER_NOT_FOUND)"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_0677dad3","line":64,"range":{"start_line":64,"start_character":19,"end_line":64,"end_character":26},"in_reply_to":"5f7c97a3_a3fff867","updated":"2018-07-23 12:37:08.000000000","message":"sort of? It\u0027s a cut and paste from pre-existing code.","commit_id":"60b0c28d49118ba6b0cd0d567baac5521015c686"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"99708dcaeaac0216755b842c14b1378d2a9673f3","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    # loaded above when creating inventory objects. The reshape method below is"},{"line_number":93,"context_line":"    # responsible for ensuring that the resource providers and their"},{"line_number":94,"context_line":"    # generations do not conflict."},{"line_number":95,"context_line":"    allocation_objects \u003d allocation.create_allocation_list("},{"line_number":96,"context_line":"        context, allocations, consumers)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    try:"},{"line_number":99,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_63b1e091","line":96,"range":{"start_line":95,"start_character":1,"end_line":96,"end_character":40},"updated":"2018-07-23 12:26:45.000000000","message":"If this ever raise an exception then the code will leak newly created consumers. As far as I see currently it can only raise for missing PRs but that is already checked at L60. Still if we want to be safe we can move this into the inner try block before L100","commit_id":"60b0c28d49118ba6b0cd0d567baac5521015c686"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"612183e04b20e01c2177a0a36dd486be812d4900","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    # loaded above when creating inventory objects. The reshape method below is"},{"line_number":93,"context_line":"    # responsible for ensuring that the resource providers and their"},{"line_number":94,"context_line":"    # generations do not conflict."},{"line_number":95,"context_line":"    allocation_objects \u003d allocation.create_allocation_list("},{"line_number":96,"context_line":"        context, allocations, consumers)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    try:"},{"line_number":99,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_49096327","line":96,"range":{"start_line":95,"start_character":1,"end_line":96,"end_character":40},"in_reply_to":"5f7c97a3_63b1e091","updated":"2018-07-23 12:37:08.000000000","message":"makes sense","commit_id":"60b0c28d49118ba6b0cd0d567baac5521015c686"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"99708dcaeaac0216755b842c14b1378d2a9673f3","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        context, allocations, consumers)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    try:"},{"line_number":99,"context_line":"        try:"},{"line_number":100,"context_line":"            rp_obj.reshape(context, inventory_by_rp, allocation_objects)"},{"line_number":101,"context_line":"        except Exception:"},{"line_number":102,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":103,"context_line":"                allocation.delete_consumers(new_consumers_created)"},{"line_number":104,"context_line":"    # Distinguish inventory in use (has allocations on it)..."},{"line_number":105,"context_line":"    except exception.InventoryInUse as exc:"},{"line_number":106,"context_line":"        raise webob.exc.HTTPConflict("}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_867c4a72","line":103,"range":{"start_line":99,"start_character":0,"end_line":103,"end_character":66},"updated":"2018-07-23 12:26:45.000000000","message":"This except block does a cleanup for a resource that was not created within the try block. So every time a new lines of code is added in between the inspect_consumers() call that creates the consumer resource and this except block that cleans it up, we have to make that line of code safe for exceptions (similarly how the inspect_consumer() itself is made safe).\nInstead I suggest to move the whole L87-L100 inside the inner try block so that later code additions are automatically and freely get the proper consumer resource cleanup.","commit_id":"60b0c28d49118ba6b0cd0d567baac5521015c686"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"99708dcaeaac0216755b842c14b1378d2a9673f3","unresolved":false,"context_lines":[{"line_number":109,"context_line":"    # ...from allocations which won\u0027t fit for a variety of reasons."},{"line_number":110,"context_line":"    except exception.InvalidInventory as exc:"},{"line_number":111,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":112,"context_line":"            _(\u0027Unable to allocate inventory: %(error)s\u0027) % {\u0027error\u0027: exc})"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    req.response.status \u003d 204"},{"line_number":115,"context_line":"    req.response.content_type \u003d None"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_e6973e46","line":112,"updated":"2018-07-23 12:26:45.000000000","message":"For me the nested try block is harder to understand than the repeated delete_consumer calls that is needed if we flatten the nested blocks to something like:\n\ntry:\n    # inspect_consumers()\n    # create_allocation_list()\n    reshape()\nexcept InventoryInUse:\n    delete_consumers()\n    raise HTTPConflict()\nexcept InvalidInventory:\n    delete_consumers()\n    raise HTTPConflict()\nexcept Exception:\n    with excutils.save_and_reraise_exception():\n        allocation.delete_consumers()","commit_id":"60b0c28d49118ba6b0cd0d567baac5521015c686"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"612183e04b20e01c2177a0a36dd486be812d4900","unresolved":false,"context_lines":[{"line_number":109,"context_line":"    # ...from allocations which won\u0027t fit for a variety of reasons."},{"line_number":110,"context_line":"    except exception.InvalidInventory as exc:"},{"line_number":111,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":112,"context_line":"            _(\u0027Unable to allocate inventory: %(error)s\u0027) % {\u0027error\u0027: exc})"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    req.response.status \u003d 204"},{"line_number":115,"context_line":"    req.response.content_type \u003d None"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_a97d9771","line":112,"in_reply_to":"5f7c97a3_e6973e46","updated":"2018-07-23 12:37:08.000000000","message":"I think in one of the bits of code that jay did related to consumer generations he had something like what you\u0027ve written here, and I had him change it because I wanted to be sure that the delete_consumers was in only one place, in case we added a step.","commit_id":"60b0c28d49118ba6b0cd0d567baac5521015c686"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f21ce59940731b579c02da83ae685e6c5957da82","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    req.response.status \u003d 204"},{"line_number":118,"context_line":"    req.response.content_type \u003d None"},{"line_number":119,"context_line":"    return req.response"}],"source_content_type":"text/x-python","patch_set":23,"id":"5f7c97a3_6e4faa68","line":119,"updated":"2018-08-01 18:49:35.000000000","message":"code in here looks great for now. agree there\u0027s some duplication from the allocation/inventory handler but that\u0027s perfectly fine for now especially since you\u0027ve noted what should be refactored.","commit_id":"323738628ae83b77fcf9b3db658e6e020e748637"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3da6ec0bbf6c05a57f4afc80a6a0cd241ad3e328","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    # We\u0027re going to create several InventoryList, by rp."},{"line_number":54,"context_line":"    inventory_by_rp \u003d {}"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    # TODO(cdent): this has overlaps with inventory:set_inventories"},{"line_number":57,"context_line":"    # and is a mess of bad names and lack of method extraction."},{"line_number":58,"context_line":"    for rp_uuid, inventory_data in inventories.items():"},{"line_number":59,"context_line":"        try:"},{"line_number":60,"context_line":"            resource_provider \u003d rp_obj.ResourceProvider.get_by_uuid("}],"source_content_type":"text/x-python","patch_set":27,"id":"3f79a3b5_1a022f0c","line":57,"range":{"start_line":56,"start_character":0,"end_line":57,"end_character":63},"updated":"2018-08-13 13:46:27.000000000","message":"Do we want to create a follow up cleaning this up?","commit_id":"9530c9af44406f37599e2b5b76f78bfdb8af116d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    context \u003d req.environ[\u0027placement.context\u0027]"},{"line_number":45,"context_line":"    want_version \u003d req.environ[microversion.MICROVERSION_ENVIRON]"},{"line_number":46,"context_line":"    # TODO(cdent): Just leaving this here as a reminder for now."},{"line_number":47,"context_line":"    # With this commented, the default \"admin only\" handling for"},{"line_number":48,"context_line":"    # policy is enforced."},{"line_number":49,"context_line":"    # context.can(policies.CREATE)"},{"line_number":50,"context_line":"    data \u003d util.extract_json(req.body, schema.POST_RESHAPER_SCHEMA)"},{"line_number":51,"context_line":"    inventories \u003d data[\u0027inventories\u0027]"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_8e014c3b","line":48,"range":{"start_line":47,"start_character":4,"end_line":48,"end_character":25},"updated":"2018-08-22 18:10:19.000000000","message":"I don\u0027t think this is true....that used to be in handler.py but was removed since each route should have it\u0027s own checks:\n\nI8ed5d00daf1b5a0ad46256ffb27a75e1e602cea3\n\nBased on that, we should have the policy rule in this same patch.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"1274d349ba0418f4e2e9053a65a6e9b55f3bdd0c","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    context \u003d req.environ[\u0027placement.context\u0027]"},{"line_number":45,"context_line":"    want_version \u003d req.environ[microversion.MICROVERSION_ENVIRON]"},{"line_number":46,"context_line":"    # TODO(cdent): Just leaving this here as a reminder for now."},{"line_number":47,"context_line":"    # With this commented, the default \"admin only\" handling for"},{"line_number":48,"context_line":"    # policy is enforced."},{"line_number":49,"context_line":"    # context.can(policies.CREATE)"},{"line_number":50,"context_line":"    data \u003d util.extract_json(req.body, schema.POST_RESHAPER_SCHEMA)"},{"line_number":51,"context_line":"    inventories \u003d data[\u0027inventories\u0027]"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_77c7c613","line":48,"range":{"start_line":47,"start_character":4,"end_line":48,"end_character":25},"in_reply_to":"3f79a3b5_1c61eba9","updated":"2018-08-23 13:42:32.000000000","message":"Chris put up https://review.openstack.org/#/c/595559/ to catch this automatically in the future.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    context \u003d req.environ[\u0027placement.context\u0027]"},{"line_number":45,"context_line":"    want_version \u003d req.environ[microversion.MICROVERSION_ENVIRON]"},{"line_number":46,"context_line":"    # TODO(cdent): Just leaving this here as a reminder for now."},{"line_number":47,"context_line":"    # With this commented, the default \"admin only\" handling for"},{"line_number":48,"context_line":"    # policy is enforced."},{"line_number":49,"context_line":"    # context.can(policies.CREATE)"},{"line_number":50,"context_line":"    data \u003d util.extract_json(req.body, schema.POST_RESHAPER_SCHEMA)"},{"line_number":51,"context_line":"    inventories \u003d data[\u0027inventories\u0027]"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_75411739","line":48,"range":{"start_line":47,"start_character":4,"end_line":48,"end_character":25},"in_reply_to":"3f79a3b5_8e014c3b","updated":"2018-08-22 21:37:53.000000000","message":"Done","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    context \u003d req.environ[\u0027placement.context\u0027]"},{"line_number":45,"context_line":"    want_version \u003d req.environ[microversion.MICROVERSION_ENVIRON]"},{"line_number":46,"context_line":"    # TODO(cdent): Just leaving this here as a reminder for now."},{"line_number":47,"context_line":"    # With this commented, the default \"admin only\" handling for"},{"line_number":48,"context_line":"    # policy is enforced."},{"line_number":49,"context_line":"    # context.can(policies.CREATE)"},{"line_number":50,"context_line":"    data \u003d util.extract_json(req.body, schema.POST_RESHAPER_SCHEMA)"},{"line_number":51,"context_line":"    inventories \u003d data[\u0027inventories\u0027]"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_e437bfaf","line":48,"range":{"start_line":47,"start_character":4,"end_line":48,"end_character":25},"in_reply_to":"3f79a3b5_8e014c3b","updated":"2018-08-22 19:06:52.000000000","message":"Sigh, how come, in all the reviews that happened up to this, we didn\u0027t know this? Or another way to ask the question is: Why didn\u0027t the person who knew this review until now?\n\nBut yeah, agree, we need policy. I\u0027ll work out with Eric which one of us will do that.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f3c16d50e12352e4f2d54e9d962edccd3a000ff3","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    context \u003d req.environ[\u0027placement.context\u0027]"},{"line_number":45,"context_line":"    want_version \u003d req.environ[microversion.MICROVERSION_ENVIRON]"},{"line_number":46,"context_line":"    # TODO(cdent): Just leaving this here as a reminder for now."},{"line_number":47,"context_line":"    # With this commented, the default \"admin only\" handling for"},{"line_number":48,"context_line":"    # policy is enforced."},{"line_number":49,"context_line":"    # context.can(policies.CREATE)"},{"line_number":50,"context_line":"    data \u003d util.extract_json(req.body, schema.POST_RESHAPER_SCHEMA)"},{"line_number":51,"context_line":"    inventories \u003d data[\u0027inventories\u0027]"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_1c61eba9","line":48,"range":{"start_line":47,"start_character":4,"end_line":48,"end_character":25},"in_reply_to":"3f79a3b5_e437bfaf","updated":"2018-08-23 00:29:11.000000000","message":"\u003e Sigh, how come, in all the reviews that happened up to this, we didn\u0027t know this? Or another way to ask the question is: Why didn\u0027t the person who knew this review until now?\n\nWell it\u0027s true that everything by default used to be admin-only b/c handler.py handled that, but no more - easy to miss. Plus there was just no 403 test otherwise it would have been clear. Testing policy is usually an afterthought.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    data \u003d util.extract_json(req.body, schema.POST_RESHAPER_SCHEMA)"},{"line_number":51,"context_line":"    inventories \u003d data[\u0027inventories\u0027]"},{"line_number":52,"context_line":"    allocations \u003d data[\u0027allocations\u0027]"},{"line_number":53,"context_line":"    # We\u0027re going to create several InventoryList, by rp."},{"line_number":54,"context_line":"    inventory_by_rp \u003d {}"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    # TODO(cdent): this has overlaps with inventory:set_inventories"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_41446547","line":53,"range":{"start_line":53,"start_character":54,"end_line":53,"end_character":56},"updated":"2018-08-22 18:10:19.000000000","message":"nit: rp_uuid","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    data \u003d util.extract_json(req.body, schema.POST_RESHAPER_SCHEMA)"},{"line_number":51,"context_line":"    inventories \u003d data[\u0027inventories\u0027]"},{"line_number":52,"context_line":"    allocations \u003d data[\u0027allocations\u0027]"},{"line_number":53,"context_line":"    # We\u0027re going to create several InventoryList, by rp."},{"line_number":54,"context_line":"    inventory_by_rp \u003d {}"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    # TODO(cdent): this has overlaps with inventory:set_inventories"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_d5710baa","line":53,"range":{"start_line":53,"start_character":54,"end_line":53,"end_character":56},"in_reply_to":"3f79a3b5_41446547","updated":"2018-08-22 21:37:53.000000000","message":"Done","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    consumers, new_consumers_created \u003d allocation.inspect_consumers("},{"line_number":89,"context_line":"        context, allocations, want_version)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    # Nest exception handling so that any exception results in new consumer"},{"line_number":92,"context_line":"    # objects being deleted, then reraise for translating to HTTP exceptions."},{"line_number":93,"context_line":"    try:"},{"line_number":94,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_a13d398f","line":91,"updated":"2018-08-22 18:10:19.000000000","message":"This is very similar to allocations:set_allocations which handles NotFound and ConcurrentUpdateDetected but I don\u0027t see those handled here, are we missing them? For example, if an allocation is listing a resource class which isn\u0027t found. And the reshape method docstring says it can raise ConcurrentUpdateDetected.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    consumers, new_consumers_created \u003d allocation.inspect_consumers("},{"line_number":89,"context_line":"        context, allocations, want_version)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    # Nest exception handling so that any exception results in new consumer"},{"line_number":92,"context_line":"    # objects being deleted, then reraise for translating to HTTP exceptions."},{"line_number":93,"context_line":"    try:"},{"line_number":94,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_158a2369","line":91,"in_reply_to":"3f79a3b5_04e3dbda","updated":"2018-08-22 21:37:53.000000000","message":"actually that notfound stuff I\u0027m saying is poppycock, too many things.\nI\u0027ll make sure there\u0027s a test and fix whatever","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f3c16d50e12352e4f2d54e9d962edccd3a000ff3","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    consumers, new_consumers_created \u003d allocation.inspect_consumers("},{"line_number":89,"context_line":"        context, allocations, want_version)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    # Nest exception handling so that any exception results in new consumer"},{"line_number":92,"context_line":"    # objects being deleted, then reraise for translating to HTTP exceptions."},{"line_number":93,"context_line":"    try:"},{"line_number":94,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_bc48f72c","line":91,"in_reply_to":"3f79a3b5_158a2369","updated":"2018-08-23 00:29:11.000000000","message":"\u003e If NotFound were to leak it is handled in the __call__ method that does dispatch in handler.py. That\u0027s there by design because NotFound is common.\n\nYeah it\u0027s there but it\u0027d be a 404 which isn\u0027t correct in this case, it should be a 400.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    consumers, new_consumers_created \u003d allocation.inspect_consumers("},{"line_number":89,"context_line":"        context, allocations, want_version)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    # Nest exception handling so that any exception results in new consumer"},{"line_number":92,"context_line":"    # objects being deleted, then reraise for translating to HTTP exceptions."},{"line_number":93,"context_line":"    try:"},{"line_number":94,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_50eae9d7","line":91,"in_reply_to":"3f79a3b5_a13d398f","updated":"2018-08-22 21:37:53.000000000","message":"Done","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    consumers, new_consumers_created \u003d allocation.inspect_consumers("},{"line_number":89,"context_line":"        context, allocations, want_version)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    # Nest exception handling so that any exception results in new consumer"},{"line_number":92,"context_line":"    # objects being deleted, then reraise for translating to HTTP exceptions."},{"line_number":93,"context_line":"    try:"},{"line_number":94,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_04e3dbda","line":91,"in_reply_to":"3f79a3b5_a13d398f","updated":"2018-08-22 19:06:52.000000000","message":"There\u0027s some discussion about this higher up in the patch stack.\n\nIf NotFound were to leak it is handled in the __call__ method that does dispatch in handler.py.  That\u0027s there by design because NotFound is common.\n\nI need to look back at that old discussion first, to recall, but the ConcurrentUpdateDetected needs a closer look","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"}],"nova/api/openstack/placement/microversion.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f6777bd2fe5c0f350be748c7218041984363e804","unresolved":false,"context_lines":[{"line_number":75,"context_line":"             # the resource class is not in the requested resources."},{"line_number":76,"context_line":"    \u00271.28\u0027,  # Add support for consumer generation"},{"line_number":77,"context_line":"    \u00271.29\u0027,  # Support nested providers in GET /allocation_candidates API."},{"line_number":78,"context_line":"    \u00271.30\u0027,  # Add POST /reshaper for reshaping resource providers."},{"line_number":79,"context_line":"]"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_c9422a0e","line":78,"range":{"start_line":78,"start_character":38,"end_line":78,"end_character":66},"updated":"2018-07-13 20:03:05.000000000","message":"\"reshaping\" doesn\u0027t add much to the name of the URI; how about \"...atomically migrating resource provider inventories and allocations.\"","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"4a69824be16085bdb2344a8cd3b4f530bc5c69ff","unresolved":false,"context_lines":[{"line_number":75,"context_line":"             # the resource class is not in the requested resources."},{"line_number":76,"context_line":"    \u00271.28\u0027,  # Add support for consumer generation"},{"line_number":77,"context_line":"    \u00271.29\u0027,  # Support nested providers in GET /allocation_candidates API."},{"line_number":78,"context_line":"    \u00271.30\u0027,  # Add POST /reshaper for reshaping resource providers."},{"line_number":79,"context_line":"]"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_b984aeb3","line":78,"range":{"start_line":78,"start_character":38,"end_line":78,"end_character":66},"in_reply_to":"5f7c97a3_c9422a0e","updated":"2018-07-16 09:49:53.000000000","message":"fair","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"}],"nova/api/openstack/placement/policies/__init__.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bf43657e096bc911b6c08d384e4629a90e18865f","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from nova.api.openstack.placement.policies import inventory"},{"line_number":20,"context_line":"from nova.api.openstack.placement.policies import resource_class"},{"line_number":21,"context_line":"from nova.api.openstack.placement.policies import resource_provider"},{"line_number":22,"context_line":"from nova.api.openstack.placement.policies import reshaper"},{"line_number":23,"context_line":"from nova.api.openstack.placement.policies import trait"},{"line_number":24,"context_line":"from nova.api.openstack.placement.policies import usage"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"3f79a3b5_5cc6836a","line":22,"updated":"2018-08-23 00:35:15.000000000","message":"pep8: imports are out of order","commit_id":"d39cd292b84a818c049a2603322a2522d8433927"}],"nova/api/openstack/placement/rest_api_version_history.rst":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"33822f3ff0959d70d0262372dbf69e53946c8f77","unresolved":false,"context_lines":[{"line_number":508,"context_line":"of inventory moves from a parent provider to a new child provider."},{"line_number":509,"context_line":""},{"line_number":510,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":511,"context_line":"          where the resource provider topology of a single physical resource"},{"line_number":512,"context_line":"          has changed. It has the potential to be slow and to lock several"},{"line_number":513,"context_line":"          database tables."}],"source_content_type":"text/x-rst","patch_set":11,"id":"5f7c97a3_f7a3ce42","line":511,"range":{"start_line":511,"start_character":52,"end_line":511,"end_character":67},"updated":"2018-07-19 15:11:23.000000000","message":"strike\n\nThis will potentially be used for multiple resources at a time, and will certainly be applied to non-physical resources.","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"39271219f068efd71a26eae84ae594acb9db86f9","unresolved":false,"context_lines":[{"line_number":508,"context_line":"of inventory moves from a parent provider to a new child provider."},{"line_number":509,"context_line":""},{"line_number":510,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":511,"context_line":"          where the resource provider topology of a single physical resource"},{"line_number":512,"context_line":"          has changed. It has the potential to be slow and to lock several"},{"line_number":513,"context_line":"          database tables."}],"source_content_type":"text/x-rst","patch_set":11,"id":"5f7c97a3_47718744","line":511,"range":{"start_line":511,"start_character":52,"end_line":511,"end_character":67},"in_reply_to":"5f7c97a3_0412adb4","updated":"2018-07-19 20:25:44.000000000","message":"Well, the other main use of this (besides the single root -\u003e nested tree re-modeling) is changing potentially hundreds (think a nova-compute managing hundreds of baremetal Ironic nodes) of providers from having \"local\" disk to consuming disk from one or more sharing providers.\n\nThat said, I think it\u0027s perfectly fine to just have a warning that says something to the effect of \"WARNING: don\u0027t use this API endpoint unless you are really sure of what you are doing.\"","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e119e1bff2fc3839ace30407ac464836ca322c00","unresolved":false,"context_lines":[{"line_number":508,"context_line":"of inventory moves from a parent provider to a new child provider."},{"line_number":509,"context_line":""},{"line_number":510,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":511,"context_line":"          where the resource provider topology of a single physical resource"},{"line_number":512,"context_line":"          has changed. It has the potential to be slow and to lock several"},{"line_number":513,"context_line":"          database tables."}],"source_content_type":"text/x-rst","patch_set":11,"id":"5f7c97a3_7d7a0676","line":511,"range":{"start_line":511,"start_character":52,"end_line":511,"end_character":67},"in_reply_to":"5f7c97a3_f7a3ce42","updated":"2018-07-20 10:46:01.000000000","message":"Done","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"1eff2fb034d1cc00840ad724b7d21c048de74509","unresolved":false,"context_lines":[{"line_number":508,"context_line":"of inventory moves from a parent provider to a new child provider."},{"line_number":509,"context_line":""},{"line_number":510,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":511,"context_line":"          where the resource provider topology of a single physical resource"},{"line_number":512,"context_line":"          has changed. It has the potential to be slow and to lock several"},{"line_number":513,"context_line":"          database tables."}],"source_content_type":"text/x-rst","patch_set":11,"id":"5f7c97a3_0412adb4","line":511,"range":{"start_line":511,"start_character":52,"end_line":511,"end_character":67},"in_reply_to":"5f7c97a3_f7a3ce42","updated":"2018-07-19 20:01:31.000000000","message":"I\u0027m trying to get at the idea that the caller is representing an entity which is the authority of the topology it is changing, and it is doing something special, rare and magical, and gosh don\u0027t do it.\n\nStriking the phrases loses that, but perhaps it doesn\u0027t matter?","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"39271219f068efd71a26eae84ae594acb9db86f9","unresolved":false,"context_lines":[{"line_number":509,"context_line":""},{"line_number":510,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":511,"context_line":"          where the resource provider topology of a single physical resource"},{"line_number":512,"context_line":"          has changed. It has the potential to be slow and to lock several"},{"line_number":513,"context_line":"          database tables."}],"source_content_type":"text/x-rst","patch_set":11,"id":"5f7c97a3_27bd6bd6","line":513,"range":{"start_line":512,"start_character":63,"end_line":513,"end_character":25},"updated":"2018-07-19 20:25:44.000000000","message":"meh, technically it doesn\u0027t lock whole tables. it just locks what are called \"gaps\" of ID values. But, your point that it is an invasive and potentially slow operation is absolutely true.","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e119e1bff2fc3839ace30407ac464836ca322c00","unresolved":false,"context_lines":[{"line_number":509,"context_line":""},{"line_number":510,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":511,"context_line":"          where the resource provider topology of a single physical resource"},{"line_number":512,"context_line":"          has changed. It has the potential to be slow and to lock several"},{"line_number":513,"context_line":"          database tables."}],"source_content_type":"text/x-rst","patch_set":11,"id":"5f7c97a3_5d770a8f","line":513,"range":{"start_line":512,"start_character":63,"end_line":513,"end_character":25},"in_reply_to":"5f7c97a3_27bd6bd6","updated":"2018-07-20 10:46:01.000000000","message":"Done","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"51b954d68956f8979287479bfa7bc302dfff9a4e","unresolved":false,"context_lines":[{"line_number":509,"context_line":""},{"line_number":510,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":511,"context_line":"          where the resource provider topology of a single physical resource"},{"line_number":512,"context_line":"          has changed. It has the potential to be slow and to lock several"},{"line_number":513,"context_line":"          database tables."}],"source_content_type":"text/x-rst","patch_set":11,"id":"5f7c97a3_faa05c90","line":513,"range":{"start_line":512,"start_character":63,"end_line":513,"end_character":25},"in_reply_to":"5f7c97a3_27bd6bd6","updated":"2018-07-20 10:03:57.000000000","message":"That was copied from the spec\u0027s performance section. I\u0027ll make something more generic.","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":507,"context_line":"the inventory moves from one resource provider to another, such as when a class"},{"line_number":508,"context_line":"of inventory moves from a parent provider to a new child provider."},{"line_number":509,"context_line":""},{"line_number":510,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":511,"context_line":"          of resource provider topology changing when inventory is in use."},{"line_number":512,"context_line":"          Only use this if you are really sure of what you are doing."}],"source_content_type":"text/x-rst","patch_set":12,"id":"5f7c97a3_32efc71c","line":512,"range":{"start_line":510,"start_character":0,"end_line":512,"end_character":69},"updated":"2018-07-21 15:51:24.000000000","message":"++","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f21ce59940731b579c02da83ae685e6c5957da82","unresolved":false,"context_lines":[{"line_number":511,"context_line":""},{"line_number":512,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":513,"context_line":"          of resource provider topology changing when inventory is in use."},{"line_number":514,"context_line":"          Only use this if you are really sure of what you are doing."}],"source_content_type":"text/x-rst","patch_set":23,"id":"5f7c97a3_8e524610","line":514,"updated":"2018-08-01 18:49:35.000000000","message":"++","commit_id":"323738628ae83b77fcf9b3db658e6e020e748637"}],"nova/api/openstack/placement/schemas/reshaper.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f6777bd2fe5c0f350be748c7218041984363e804","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            \"type\": \"object\","},{"line_number":28,"context_line":"            \"patternProperties\": {"},{"line_number":29,"context_line":"                # resource provider uuid"},{"line_number":30,"context_line":"                \"^[0-9a-fA-F-]{36}$\": inventory.PUT_INVENTORY_SCHEMA,"},{"line_number":31,"context_line":"            },"},{"line_number":32,"context_line":"            \"minProperties\": 1,"},{"line_number":33,"context_line":"            \"additionalProperties\": False,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_090fc2e0","line":30,"range":{"start_line":30,"start_character":16,"end_line":30,"end_character":36},"updated":"2018-07-13 20:03:05.000000000","message":"Could make this moar betr as\n\n \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\"\n\n...which we should of course const somewhere so we don\u0027t have to copy it everywhere we need a UUID.\n\nHave we had this conversation before?","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"4a69824be16085bdb2344a8cd3b4f530bc5c69ff","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            \"type\": \"object\","},{"line_number":28,"context_line":"            \"patternProperties\": {"},{"line_number":29,"context_line":"                # resource provider uuid"},{"line_number":30,"context_line":"                \"^[0-9a-fA-F-]{36}$\": inventory.PUT_INVENTORY_SCHEMA,"},{"line_number":31,"context_line":"            },"},{"line_number":32,"context_line":"            \"minProperties\": 1,"},{"line_number":33,"context_line":"            \"additionalProperties\": False,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_99a2123f","line":30,"range":{"start_line":30,"start_character":16,"end_line":30,"end_character":36},"in_reply_to":"5f7c97a3_090fc2e0","updated":"2018-07-16 09:49:53.000000000","message":"Probably, not sure it want to do that here. Might be better to do it as part of unified \"fix handling of uuids all over placement\" thing.","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3eb6f509719f16d87a4bbf3baaccfc6d9aa81e65","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            \"type\": \"object\","},{"line_number":28,"context_line":"            \"patternProperties\": {"},{"line_number":29,"context_line":"                # resource provider uuid"},{"line_number":30,"context_line":"                \"^[0-9a-fA-F-]{36}$\": inventory.PUT_INVENTORY_SCHEMA,"},{"line_number":31,"context_line":"            },"},{"line_number":32,"context_line":"            \"minProperties\": 1,"},{"line_number":33,"context_line":"            \"additionalProperties\": False,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_ad588330","line":30,"range":{"start_line":30,"start_character":16,"end_line":30,"end_character":36},"in_reply_to":"5f7c97a3_99a2123f","updated":"2018-08-14 22:40:58.000000000","message":"https://review.openstack.org/#/c/591863/","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f6777bd2fe5c0f350be748c7218041984363e804","unresolved":false,"context_lines":[{"line_number":29,"context_line":"                # resource provider uuid"},{"line_number":30,"context_line":"                \"^[0-9a-fA-F-]{36}$\": inventory.PUT_INVENTORY_SCHEMA,"},{"line_number":31,"context_line":"            },"},{"line_number":32,"context_line":"            \"minProperties\": 1,"},{"line_number":33,"context_line":"            \"additionalProperties\": False,"},{"line_number":34,"context_line":"        },"},{"line_number":35,"context_line":"        \"allocations\": ALLOCATIONS,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_89faf2b7","line":32,"range":{"start_line":32,"start_character":12,"end_line":32,"end_character":31},"updated":"2018-07-13 20:03:05.000000000","message":"Did we decide it\u0027s not possible to have a scenario where I just need to move allocations around, without moving inventories?","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":29,"context_line":"                # resource provider uuid"},{"line_number":30,"context_line":"                \"^[0-9a-fA-F-]{36}$\": inventory.PUT_INVENTORY_SCHEMA,"},{"line_number":31,"context_line":"            },"},{"line_number":32,"context_line":"            \"minProperties\": 1,"},{"line_number":33,"context_line":"            \"additionalProperties\": False,"},{"line_number":34,"context_line":"        },"},{"line_number":35,"context_line":"        \"allocations\": ALLOCATIONS,"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_92dfbb65","line":32,"range":{"start_line":32,"start_character":12,"end_line":32,"end_character":31},"updated":"2018-07-21 15:51:24.000000000","message":"I made a comment earlier that got lost, but I can\u0027t find it now (might have been in IRC or something) but I referred to it at [1]. The gist: Why should we disallow empty inventory in the schema?\n\n[1] https://review.openstack.org/#/c/576927/5/nova/tests/functional/api/openstack/placement/gabbits/reshaper.yaml@74","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"073289ef45452a61489ef766dc01b2f14b1ce09c","unresolved":false,"context_lines":[{"line_number":29,"context_line":"                # resource provider uuid"},{"line_number":30,"context_line":"                \"^[0-9a-fA-F-]{36}$\": inventory.PUT_INVENTORY_SCHEMA,"},{"line_number":31,"context_line":"            },"},{"line_number":32,"context_line":"            \"minProperties\": 1,"},{"line_number":33,"context_line":"            \"additionalProperties\": False,"},{"line_number":34,"context_line":"        },"},{"line_number":35,"context_line":"        \"allocations\": ALLOCATIONS,"}],"source_content_type":"text/x-python","patch_set":12,"id":"5f7c97a3_d2cc538b","line":32,"range":{"start_line":32,"start_character":12,"end_line":32,"end_character":31},"in_reply_to":"5f7c97a3_92dfbb65","updated":"2018-07-21 16:29:11.000000000","message":"I seem to recall that conversation in IRC and I think the gist of the why is because unless you have inventory that is changing, there\u0027s no reason to reshape?\n\nAlso, your comment on [1] doesn\u0027t apply because we are already re-using the top layer schema from inventory, this structure is layer above.","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"97a5f94b503941cb151879c0c407e91fa0543b30","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"ALLOCATIONS \u003d copy.deepcopy(allocation.POST_ALLOCATIONS_V1_28)"},{"line_number":21,"context_line":"# In the reshaper we call allow allocations to be an empty dict."},{"line_number":22,"context_line":"ALLOCATIONS[\u0027minProperties\u0027] \u003d 0"},{"line_number":23,"context_line":"POST_RESHAPER_SCHEMA \u003d {"},{"line_number":24,"context_line":"    \"type\": \"object\","}],"source_content_type":"text/x-python","patch_set":24,"id":"5f7c97a3_ab2da690","line":21,"range":{"start_line":21,"start_character":21,"end_line":21,"end_character":25},"updated":"2018-08-02 09:03:35.000000000","message":"nit:can","commit_id":"262e881f24732bb3f9952d8d1d2def2778dfc890"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a02a227c221c87bc47d2d9c6f3347536872200cc","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"ALLOCATIONS \u003d copy.deepcopy(allocation.POST_ALLOCATIONS_V1_28)"},{"line_number":21,"context_line":"# In the reshaper we call allow allocations to be an empty dict."},{"line_number":22,"context_line":"ALLOCATIONS[\u0027minProperties\u0027] \u003d 0"},{"line_number":23,"context_line":"POST_RESHAPER_SCHEMA \u003d {"},{"line_number":24,"context_line":"    \"type\": \"object\","}],"source_content_type":"text/x-python","patch_set":24,"id":"3f79a3b5_ef36e1e7","line":21,"range":{"start_line":21,"start_character":21,"end_line":21,"end_character":25},"in_reply_to":"5f7c97a3_ab2da690","updated":"2018-08-21 17:15:20.000000000","message":"Done","commit_id":"262e881f24732bb3f9952d8d1d2def2778dfc890"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3da6ec0bbf6c05a57f4afc80a6a0cd241ad3e328","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"ALLOCATIONS \u003d copy.deepcopy(allocation.POST_ALLOCATIONS_V1_28)"},{"line_number":21,"context_line":"# In the reshaper we call allow allocations to be an empty dict."},{"line_number":22,"context_line":"ALLOCATIONS[\u0027minProperties\u0027] \u003d 0"},{"line_number":23,"context_line":"POST_RESHAPER_SCHEMA \u003d {"},{"line_number":24,"context_line":"    \"type\": \"object\","}],"source_content_type":"text/x-python","patch_set":27,"id":"3f79a3b5_fa7df3b1","line":21,"range":{"start_line":21,"start_character":21,"end_line":21,"end_character":25},"updated":"2018-08-13 13:46:27.000000000","message":"nit: can","commit_id":"9530c9af44406f37599e2b5b76f78bfdb8af116d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a02a227c221c87bc47d2d9c6f3347536872200cc","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"ALLOCATIONS \u003d copy.deepcopy(allocation.POST_ALLOCATIONS_V1_28)"},{"line_number":21,"context_line":"# In the reshaper we call allow allocations to be an empty dict."},{"line_number":22,"context_line":"ALLOCATIONS[\u0027minProperties\u0027] \u003d 0"},{"line_number":23,"context_line":"POST_RESHAPER_SCHEMA \u003d {"},{"line_number":24,"context_line":"    \"type\": \"object\","}],"source_content_type":"text/x-python","patch_set":27,"id":"3f79a3b5_2fb5b9cd","line":21,"range":{"start_line":21,"start_character":21,"end_line":21,"end_character":25},"in_reply_to":"3f79a3b5_fa7df3b1","updated":"2018-08-21 17:15:20.000000000","message":"Done","commit_id":"9530c9af44406f37599e2b5b76f78bfdb8af116d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"ALLOCATIONS \u003d copy.deepcopy(allocation.POST_ALLOCATIONS_V1_28)"},{"line_number":22,"context_line":"# In the reshaper we can allow allocations to be an empty dict."},{"line_number":23,"context_line":"ALLOCATIONS[\u0027minProperties\u0027] \u003d 0"},{"line_number":24,"context_line":"POST_RESHAPER_SCHEMA \u003d {"},{"line_number":25,"context_line":"    \"type\": \"object\","}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_6e7710d6","line":22,"updated":"2018-08-22 18:10:19.000000000","message":"OK, because we can move all inventory from the root provider to child providers and the allocations for those resource classes can move with them. And/or because there simply might not be any allocations currently on the resource class? Might be nice to expand on this comment.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"ALLOCATIONS \u003d copy.deepcopy(allocation.POST_ALLOCATIONS_V1_28)"},{"line_number":22,"context_line":"# In the reshaper we can allow allocations to be an empty dict."},{"line_number":23,"context_line":"ALLOCATIONS[\u0027minProperties\u0027] \u003d 0"},{"line_number":24,"context_line":"POST_RESHAPER_SCHEMA \u003d {"},{"line_number":25,"context_line":"    \"type\": \"object\","}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_f0a1b5aa","line":22,"in_reply_to":"3f79a3b5_6e7710d6","updated":"2018-08-22 21:37:53.000000000","message":"Done","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8e153974877d444eabb1dd8b26c01b3a3f34ab7b","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"ALLOCATIONS \u003d copy.deepcopy(allocation.POST_ALLOCATIONS_V1_28)"},{"line_number":22,"context_line":"# In the reshaper we can allow allocations to be an empty dict."},{"line_number":23,"context_line":"ALLOCATIONS[\u0027minProperties\u0027] \u003d 0"},{"line_number":24,"context_line":"POST_RESHAPER_SCHEMA \u003d {"},{"line_number":25,"context_line":"    \"type\": \"object\","}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_5ac3ea57","line":22,"in_reply_to":"3f79a3b5_6e7710d6","updated":"2018-08-22 20:18:26.000000000","message":"Not that first thing, because an allocation includes a provider UUID. If you try that, you\u0027ll get InventoryInUse when we try to remove the inventory from the old provider.\n\nBut the second thing yes.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":30,"context_line":"                # resource provider uuid"},{"line_number":31,"context_line":"                common.UUID_PATTERN: inventory.PUT_INVENTORY_SCHEMA,"},{"line_number":32,"context_line":"            },"},{"line_number":33,"context_line":"            \"minProperties\": 1,"},{"line_number":34,"context_line":"            \"additionalProperties\": False,"},{"line_number":35,"context_line":"        },"},{"line_number":36,"context_line":"        \"allocations\": ALLOCATIONS,"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_01050d11","line":33,"range":{"start_line":33,"start_character":12,"end_line":33,"end_character":31},"updated":"2018-08-22 18:10:19.000000000","message":"OK this is 1 because while you can have 0 allocations, if you\u0027re reshaping, you must provide at least one inventory to reshape, yes?","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":30,"context_line":"                # resource provider uuid"},{"line_number":31,"context_line":"                common.UUID_PATTERN: inventory.PUT_INVENTORY_SCHEMA,"},{"line_number":32,"context_line":"            },"},{"line_number":33,"context_line":"            \"minProperties\": 1,"},{"line_number":34,"context_line":"            \"additionalProperties\": False,"},{"line_number":35,"context_line":"        },"},{"line_number":36,"context_line":"        \"allocations\": ALLOCATIONS,"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_9092c156","line":33,"range":{"start_line":33,"start_character":12,"end_line":33,"end_character":31},"in_reply_to":"3f79a3b5_01050d11","updated":"2018-08-22 21:37:53.000000000","message":"Done","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":30,"context_line":"                # resource provider uuid"},{"line_number":31,"context_line":"                common.UUID_PATTERN: inventory.PUT_INVENTORY_SCHEMA,"},{"line_number":32,"context_line":"            },"},{"line_number":33,"context_line":"            \"minProperties\": 1,"},{"line_number":34,"context_line":"            \"additionalProperties\": False,"},{"line_number":35,"context_line":"        },"},{"line_number":36,"context_line":"        \"allocations\": ALLOCATIONS,"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_3f8e2079","line":33,"range":{"start_line":33,"start_character":12,"end_line":33,"end_character":31},"in_reply_to":"3f79a3b5_01050d11","updated":"2018-08-22 19:06:52.000000000","message":"yes, otherwise there\u0027s no reason to call the reshaper","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"}],"nova/tests/functional/api/openstack/placement/fixtures/gabbits.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9f4405da1b0ed604a337cb12ff0e3007f8acb4ae","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            objects\u003d[alloc1, alloc2]"},{"line_number":187,"context_line":"        )"},{"line_number":188,"context_line":"        alloc_list.replace_all()"},{"line_number":189,"context_line":"        os.environ[\u0027CONSUMER_0\u0027] \u003d consumer_id"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        # Create a second consumer for the VCPU"},{"line_number":192,"context_line":"        consumer_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_88d7f1c0","line":189,"updated":"2018-07-17 16:36:05.000000000","message":"note that on line 197 we\u0027re already setting CONSUMER_ID environ to consumer_id. Did you need this for a specific reason?","commit_id":"84536063adf5f0f80de2eb38af5a45219245f228"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"20d3b5ddc75026ec4481bc2022267dbdca49428d","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            objects\u003d[alloc1, alloc2]"},{"line_number":187,"context_line":"        )"},{"line_number":188,"context_line":"        alloc_list.replace_all()"},{"line_number":189,"context_line":"        os.environ[\u0027CONSUMER_0\u0027] \u003d consumer_id"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        # Create a second consumer for the VCPU"},{"line_number":192,"context_line":"        consumer_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_880a9124","line":189,"in_reply_to":"5f7c97a3_88d7f1c0","updated":"2018-07-17 16:42:11.000000000","message":"consumer_id is reused in the fixture. The first consumer (this one) sets the above allocations, and is never put on an environ variable.\n\nThe second one (line 192) ends up on CONSUMER_ID","commit_id":"84536063adf5f0f80de2eb38af5a45219245f228"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f21ce59940731b579c02da83ae685e6c5957da82","unresolved":false,"context_lines":[{"line_number":175,"context_line":"            objects\u003d[alloc1, alloc2]"},{"line_number":176,"context_line":"        )"},{"line_number":177,"context_line":"        alloc_list.replace_all()"},{"line_number":178,"context_line":"        os.environ[\u0027CONSUMER_0\u0027] \u003d consumer_id"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        # Create a second consumer for the VCPU"},{"line_number":181,"context_line":"        consumer_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":23,"id":"5f7c97a3_eeb09a43","line":178,"updated":"2018-08-01 18:49:35.000000000","message":"I still think this isn\u0027t the best name for the env variable :) But I understand why you did this here and think a future refactoring is fine.","commit_id":"323738628ae83b77fcf9b3db658e6e020e748637"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"603d3f824a8d600242b83ba765bfbc32d8490ac4","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        # Stealing from the super"},{"line_number":158,"context_line":"        rp_name \u003d os.environ[\u0027RP_NAME\u0027]"},{"line_number":159,"context_line":"        rp_uuid \u003d os.environ[\u0027RP_UUID\u0027]"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"        # Create the rp with VCPU and DISK_GB inventory"},{"line_number":162,"context_line":"        rp \u003d tb.create_provider(self.context, rp_name, uuid\u003drp_uuid)"},{"line_number":163,"context_line":"        tb.add_inventory(rp, \u0027DISK_GB\u0027, 2048,"}],"source_content_type":"text/x-python","patch_set":27,"id":"3f79a3b5_f1b111e3","line":160,"updated":"2018-08-07 16:20:17.000000000","message":"After the rebase, this looks like an odd and fairly pointless delta.","commit_id":"9530c9af44406f37599e2b5b76f78bfdb8af116d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"1651430161ac1b4c34e4511d9c87644f4d8b035f","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        # Stealing from the super"},{"line_number":158,"context_line":"        rp_name \u003d os.environ[\u0027RP_NAME\u0027]"},{"line_number":159,"context_line":"        rp_uuid \u003d os.environ[\u0027RP_UUID\u0027]"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"        # Create the rp with VCPU and DISK_GB inventory"},{"line_number":162,"context_line":"        rp \u003d tb.create_provider(self.context, rp_name, uuid\u003drp_uuid)"},{"line_number":163,"context_line":"        tb.add_inventory(rp, \u0027DISK_GB\u0027, 2048,"}],"source_content_type":"text/x-python","patch_set":27,"id":"3f79a3b5_b155d952","line":160,"in_reply_to":"3f79a3b5_f1b111e3","updated":"2018-08-07 16:24:20.000000000","message":"That\u0027s an artifact from resolving the merge conflict, which was vaguely hairy because it was a lot different.\n\nThat, combined with my natural inclination for whitespace before a comment that feels like a paragraph intro, made this.","commit_id":"9530c9af44406f37599e2b5b76f78bfdb8af116d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        # Stealing from the super"},{"line_number":161,"context_line":"        rp_name \u003d os.environ[\u0027RP_NAME\u0027]"},{"line_number":162,"context_line":"        rp_uuid \u003d os.environ[\u0027RP_UUID\u0027]"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        # Create the rp with VCPU and DISK_GB inventory"},{"line_number":165,"context_line":"        rp \u003d tb.create_provider(self.context, rp_name, uuid\u003drp_uuid)"},{"line_number":166,"context_line":"        tb.add_inventory(rp, \u0027DISK_GB\u0027, 2048,"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_e10571c3","line":163,"updated":"2018-08-22 18:10:19.000000000","message":"outrageous!","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f3c16d50e12352e4f2d54e9d962edccd3a000ff3","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        # Stealing from the super"},{"line_number":161,"context_line":"        rp_name \u003d os.environ[\u0027RP_NAME\u0027]"},{"line_number":162,"context_line":"        rp_uuid \u003d os.environ[\u0027RP_UUID\u0027]"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        # Create the rp with VCPU and DISK_GB inventory"},{"line_number":165,"context_line":"        rp \u003d tb.create_provider(self.context, rp_name, uuid\u003drp_uuid)"},{"line_number":166,"context_line":"        tb.add_inventory(rp, \u0027DISK_GB\u0027, 2048,"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_9c741b6a","line":163,"in_reply_to":"3f79a3b5_dae85ab4","updated":"2018-08-23 00:29:11.000000000","message":"Heh, I don\u0027t actually care, I just like to act like it\u0027s a huge problem.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        # Stealing from the super"},{"line_number":161,"context_line":"        rp_name \u003d os.environ[\u0027RP_NAME\u0027]"},{"line_number":162,"context_line":"        rp_uuid \u003d os.environ[\u0027RP_UUID\u0027]"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        # Create the rp with VCPU and DISK_GB inventory"},{"line_number":165,"context_line":"        rp \u003d tb.create_provider(self.context, rp_name, uuid\u003drp_uuid)"},{"line_number":166,"context_line":"        tb.add_inventory(rp, \u0027DISK_GB\u0027, 2048,"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_5098a973","line":163,"in_reply_to":"3f79a3b5_e10571c3","updated":"2018-08-22 21:37:53.000000000","message":"Done","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        # Stealing from the super"},{"line_number":161,"context_line":"        rp_name \u003d os.environ[\u0027RP_NAME\u0027]"},{"line_number":162,"context_line":"        rp_uuid \u003d os.environ[\u0027RP_UUID\u0027]"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        # Create the rp with VCPU and DISK_GB inventory"},{"line_number":165,"context_line":"        rp \u003d tb.create_provider(self.context, rp_name, uuid\u003drp_uuid)"},{"line_number":166,"context_line":"        tb.add_inventory(rp, \u0027DISK_GB\u0027, 2048,"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_ff842860","line":163,"in_reply_to":"3f79a3b5_e10571c3","updated":"2018-08-22 19:06:52.000000000","message":"see discussion earlier in the stack about merge weirdness, this probably could have been fixed along the way but probably got forgotten","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8e153974877d444eabb1dd8b26c01b3a3f34ab7b","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        # Stealing from the super"},{"line_number":161,"context_line":"        rp_name \u003d os.environ[\u0027RP_NAME\u0027]"},{"line_number":162,"context_line":"        rp_uuid \u003d os.environ[\u0027RP_UUID\u0027]"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        # Create the rp with VCPU and DISK_GB inventory"},{"line_number":165,"context_line":"        rp \u003d tb.create_provider(self.context, rp_name, uuid\u003drp_uuid)"},{"line_number":166,"context_line":"        tb.add_inventory(rp, \u0027DISK_GB\u0027, 2048,"}],"source_content_type":"text/x-python","patch_set":33,"id":"3f79a3b5_dae85ab4","line":163,"in_reply_to":"3f79a3b5_ff842860","updated":"2018-08-22 20:18:26.000000000","message":"ftr, I did see it and considered fixing it in PS31, but didn\u0027t because of cdent\u0027s excuses^Wreasoning at https://review.openstack.org/#/c/576927/27/nova/tests/functional/api/openstack/placement/fixtures/gabbits.py@160","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"}],"nova/tests/functional/api/openstack/placement/gabbits/reshaper.yaml":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"496ebab4277b582ba04da4d1da4a1f34a3135e56","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":72,"context_line":"                      resources:"},{"line_number":73,"context_line":"                          VCPU: 1"},{"line_number":74,"context_line":"              consumer_generation: null"},{"line_number":75,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":76,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"},{"line_number":77,"context_line":"  status: 204"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_24680e86","line":74,"range":{"start_line":74,"start_character":35,"end_line":74,"end_character":39},"updated":"2018-07-09 08:43:21.000000000","message":"What does null mean here? Is it the case when a legacy allocation (having some non null generation) split to two new allocations during the reshape?","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"76b71c0c89666d932508fe197149cdb46227f017","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":72,"context_line":"                      resources:"},{"line_number":73,"context_line":"                          VCPU: 1"},{"line_number":74,"context_line":"              consumer_generation: null"},{"line_number":75,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":76,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"},{"line_number":77,"context_line":"  status: 204"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_aa6dc5cb","line":74,"range":{"start_line":74,"start_character":35,"end_line":74,"end_character":39},"in_reply_to":"5f7c97a3_24680e86","updated":"2018-07-09 10:09:12.000000000","message":"This was mostly just to drive the schema creation and validation, which is trying, if possible, to be a duplicate of existing schema.\n\nSo while we don\u0027t have a current use case for the reshaper where an allocation would move from an existing consumer to a new consumer (thus needing a fresh generation) it fits well in the schema and data model as well as the longer term view of what the reshaper _might_ be able to do.\n\nMy preference would be to go ahead and allow that so we don\u0027t have to have tiny tweaks between very similar but not quite the same schema.","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f6777bd2fe5c0f350be748c7218041984363e804","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":72,"context_line":"                      resources:"},{"line_number":73,"context_line":"                          VCPU: 1"},{"line_number":74,"context_line":"              consumer_generation: null"},{"line_number":75,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":76,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"},{"line_number":77,"context_line":"  status: 204"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_a9ca4e6c","line":74,"range":{"start_line":74,"start_character":35,"end_line":74,"end_character":39},"in_reply_to":"5f7c97a3_aa6dc5cb","updated":"2018-07-13 20:03:05.000000000","message":"\u003e My preference would be to go ahead and allow that so we don\u0027t have\n \u003e to have tiny tweaks between very similar but not quite the same\n \u003e schema.\n\nHell to the ++.\n\n(which is also a reasonable rationale for allowing empty inventories, btw)","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9fcf1339679ac6b9353d0db9ea0a61284684d3fc","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":72,"context_line":"                      resources:"},{"line_number":73,"context_line":"                          VCPU: 1"},{"line_number":74,"context_line":"              consumer_generation: null"},{"line_number":75,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":76,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"},{"line_number":77,"context_line":"  status: 204"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_ba260067","line":74,"range":{"start_line":74,"start_character":35,"end_line":74,"end_character":39},"in_reply_to":"5f7c97a3_aa6dc5cb","updated":"2018-07-13 13:39:19.000000000","message":"The way reshape() is currently implemented, it doesn\u0027t really matter what you put in the consumer generation here.\n\nFor reference, here is the proposed implementation of the reshape() method on the DB side:\n\nhttps://review.openstack.org/#/c/582383/1/nova/api/openstack/placement/objects/resource_provider.py\n\nWe essentially blow away the allocations for all resource providers involved in the reshaper operation (in order to prevent InventoryInUse exceptions when removing inventory records in the ResourceProvider.set_inventory() calls) and because there is now code that auto-deletes any consumer that has no allocations (which always is the case for any consumer involved in the reshape operation because we just blew away all the resource provider\u0027s allocations in order to replace/move the inventory records for those providers), we end up deleting the consumer records entirely and thus need to completely re-create the consumer records before the final AllocationList.create_all() operation.\n\nWhat this means in practice is that consumers involved in the reshape operation will end up being recreated and get a new generation.\n\nThe other option is to not re-use any of these existing methods:\n\nAllocationList.delete_all()\nAllocationList.create_all()\n\nbecause each of the above methods blows away everything to do with either a resource provider\u0027s inventory records *or* a set of consumer\u0027s allocation records, which ends up causing the \"auto-delete consumers with no allocations\" to delete those consumer records.\n\nFurthermore, we could not use the existing \nResourceProvider.set_inventory() method which also blows away all the existing inventory records for a resource provider before re-creating them with the inventories passed to that method. This would allow us to not have to do the resource provider generation dance that currently happens in the proposed reshape() implementation.\n\nEric makes the argument that the consumer generations for consumers involved in the reshape() operation should be incremented from their original setting and that there should be some sort of check around these generation increments. I disagree because I think that any caller of a \"replace the world\" operation like POST /reshaper is essentially saying \"to heck with it, just make things equal to what I\u0027m giving you.","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f6777bd2fe5c0f350be748c7218041984363e804","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":72,"context_line":"                      resources:"},{"line_number":73,"context_line":"                          VCPU: 1"},{"line_number":74,"context_line":"              consumer_generation: null"},{"line_number":75,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":76,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"},{"line_number":77,"context_line":"  status: 204"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_1f683df2","line":74,"range":{"start_line":74,"start_character":35,"end_line":74,"end_character":39},"in_reply_to":"5f7c97a3_ba260067","updated":"2018-07-13 20:03:05.000000000","message":"This was a yesterday story. The today story [1] hopefully treats generations correctly, including both enforcement of incoming and increment of outgoing.\n\n[1] https://review.openstack.org/#/c/582663/","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"496ebab4277b582ba04da4d1da4a1f34a3135e56","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":106,"context_line":"                      resources:"},{"line_number":107,"context_line":"                          VCPU: 1"},{"line_number":108,"context_line":"              consumer_generation: 1"},{"line_number":109,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":110,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"},{"line_number":111,"context_line":"  status: 409"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_04be32d3","line":108,"range":{"start_line":108,"start_character":14,"end_line":108,"end_character":36},"updated":"2018-07-09 08:43:21.000000000","message":"Based on the test case name I\u0027m missing something about consumer_generation handling","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"76b71c0c89666d932508fe197149cdb46227f017","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":106,"context_line":"                      resources:"},{"line_number":107,"context_line":"                          VCPU: 1"},{"line_number":108,"context_line":"              consumer_generation: 1"},{"line_number":109,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":110,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"},{"line_number":111,"context_line":"  status: 409"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_6af24de5","line":108,"range":{"start_line":108,"start_character":14,"end_line":108,"end_character":36},"in_reply_to":"5f7c97a3_04be32d3","updated":"2018-07-09 10:09:12.000000000","message":"After the successful post above, at line 59, the expected generation here is 0.\n\nI can make the test a bit more clear on that by adding a string test for \"expected 0 but got 1\"","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f6777bd2fe5c0f350be748c7218041984363e804","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":106,"context_line":"                      resources:"},{"line_number":107,"context_line":"                          VCPU: 1"},{"line_number":108,"context_line":"              consumer_generation: 1"},{"line_number":109,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":110,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"},{"line_number":111,"context_line":"  status: 409"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_49a13aa8","line":108,"range":{"start_line":108,"start_character":14,"end_line":108,"end_character":36},"in_reply_to":"5f7c97a3_6af24de5","updated":"2018-07-13 20:03:05.000000000","message":"yeah, and/or a comment at this line, and/or just passing something wild like 99 here.","commit_id":"686ab7be053a8a87f159b88b9608760f5bacfd4b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9f4405da1b0ed604a337cb12ff0e3007f8acb4ae","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"# TODO(cdent): More needed here in a couple of ways."},{"line_number":136,"context_line":"#"},{"line_number":137,"context_line":"# a) This test fails with a ConcurrentUpdateDetected during replace_all"},{"line_number":138,"context_line":"# File \"nova/api/openstack/placement/objects/resource_provider.py\", line 2008, in _set_allocations"},{"line_number":139,"context_line":"#         rp.generation \u003d _increment_provider_generation(context, rp)"},{"line_number":140,"context_line":"#               File \"nova/api/openstack/placement/objects/resource_provider.py\", line 281, in _increment_provider_generation"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"5f7c97a3_e8e785aa","line":137,"updated":"2018-07-17 16:36:05.000000000","message":"this should be passing now with the latest rev of the dependent patch, yes?","commit_id":"84536063adf5f0f80de2eb38af5a45219245f228"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"20d3b5ddc75026ec4481bc2022267dbdca49428d","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"# TODO(cdent): More needed here in a couple of ways."},{"line_number":136,"context_line":"#"},{"line_number":137,"context_line":"# a) This test fails with a ConcurrentUpdateDetected during replace_all"},{"line_number":138,"context_line":"# File \"nova/api/openstack/placement/objects/resource_provider.py\", line 2008, in _set_allocations"},{"line_number":139,"context_line":"#         rp.generation \u003d _increment_provider_generation(context, rp)"},{"line_number":140,"context_line":"#               File \"nova/api/openstack/placement/objects/resource_provider.py\", line 281, in _increment_provider_generation"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"5f7c97a3_a8074d1d","line":137,"in_reply_to":"5f7c97a3_e8e785aa","updated":"2018-07-17 16:42:11.000000000","message":"yes","commit_id":"84536063adf5f0f80de2eb38af5a45219245f228"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9f4405da1b0ed604a337cb12ff0e3007f8acb4ae","unresolved":false,"context_lines":[{"line_number":175,"context_line":"      # these consumer generations are all 1 because they have"},{"line_number":176,"context_line":"      # previously allocated"},{"line_number":177,"context_line":"      allocations:"},{"line_number":178,"context_line":"          $ENVIRON[\u0027CONSUMER_0\u0027]:"},{"line_number":179,"context_line":"              allocations:"},{"line_number":180,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":181,"context_line":"                      resources:"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"5f7c97a3_688855c2","line":178,"range":{"start_line":178,"start_character":20,"end_line":178,"end_character":30},"updated":"2018-07-17 16:36:05.000000000","message":"unless I\u0027m mistaken you could just use CONSUMER_ID here?","commit_id":"84536063adf5f0f80de2eb38af5a45219245f228"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"20d3b5ddc75026ec4481bc2022267dbdca49428d","unresolved":false,"context_lines":[{"line_number":175,"context_line":"      # these consumer generations are all 1 because they have"},{"line_number":176,"context_line":"      # previously allocated"},{"line_number":177,"context_line":"      allocations:"},{"line_number":178,"context_line":"          $ENVIRON[\u0027CONSUMER_0\u0027]:"},{"line_number":179,"context_line":"              allocations:"},{"line_number":180,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":181,"context_line":"                      resources:"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"5f7c97a3_bc0f922d","line":178,"range":{"start_line":178,"start_character":20,"end_line":178,"end_character":30},"in_reply_to":"5f7c97a3_688855c2","updated":"2018-07-17 16:42:11.000000000","message":"See my comment on the fixture, but this is a different consumer and different allocations.\n\nIt is the same user and project id, but a different consumer.","commit_id":"84536063adf5f0f80de2eb38af5a45219245f228"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"33822f3ff0959d70d0262372dbf69e53946c8f77","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                      total: 2048"},{"line_number":148,"context_line":"                      step_size: 10"},{"line_number":149,"context_line":"                      min_unit: 10"},{"line_number":150,"context_line":"                      # this was 600 originally but we reset it to 1200"},{"line_number":151,"context_line":"                      # here because the fixture allocated twice for"},{"line_number":152,"context_line":"                      # the same consumer and we can\u0027t do that from"},{"line_number":153,"context_line":"                      # the api."},{"line_number":154,"context_line":"                      max_unit: 1200"},{"line_number":155,"context_line":"          # This resource provider does not exist."},{"line_number":156,"context_line":"          \u002739bafc00-3fff-444d-b87a-2ead3f866e05\u0027:"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"5f7c97a3_7e3457df","line":153,"range":{"start_line":150,"start_character":22,"end_line":153,"end_character":32},"updated":"2018-07-19 15:11:23.000000000","message":"This is annoying. Can we change the fixture? (I haven\u0027t looked closer.)","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                      total: 2048"},{"line_number":148,"context_line":"                      step_size: 10"},{"line_number":149,"context_line":"                      min_unit: 10"},{"line_number":150,"context_line":"                      # this was 600 originally but we reset it to 1200"},{"line_number":151,"context_line":"                      # here because the fixture allocated twice for"},{"line_number":152,"context_line":"                      # the same consumer and we can\u0027t do that from"},{"line_number":153,"context_line":"                      # the api."},{"line_number":154,"context_line":"                      max_unit: 1200"},{"line_number":155,"context_line":"          # This resource provider does not exist."},{"line_number":156,"context_line":"          \u002739bafc00-3fff-444d-b87a-2ead3f866e05\u0027:"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"5f7c97a3_5234c3ab","line":153,"range":{"start_line":150,"start_character":22,"end_line":153,"end_character":32},"in_reply_to":"5f7c97a3_441bc5c9","updated":"2018-07-21 15:51:24.000000000","message":"\u003e If I hadn\u0027t commented,\n \u003e would you have noticed?\n\nCertainly not.","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"1eff2fb034d1cc00840ad724b7d21c048de74509","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                      total: 2048"},{"line_number":148,"context_line":"                      step_size: 10"},{"line_number":149,"context_line":"                      min_unit: 10"},{"line_number":150,"context_line":"                      # this was 600 originally but we reset it to 1200"},{"line_number":151,"context_line":"                      # here because the fixture allocated twice for"},{"line_number":152,"context_line":"                      # the same consumer and we can\u0027t do that from"},{"line_number":153,"context_line":"                      # the api."},{"line_number":154,"context_line":"                      max_unit: 1200"},{"line_number":155,"context_line":"          # This resource provider does not exist."},{"line_number":156,"context_line":"          \u002739bafc00-3fff-444d-b87a-2ead3f866e05\u0027:"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"5f7c97a3_441bc5c9","line":153,"range":{"start_line":150,"start_character":22,"end_line":153,"end_character":32},"in_reply_to":"5f7c97a3_7e3457df","updated":"2018-07-19 20:01:31.000000000","message":"It would require changing some other tests, which seemed like a lame thing to do in this change, and in this case it actually manages to demonstrate part of the interesting-ness of the /reshaper so I\u0027m not too bothered by it. If I hadn\u0027t commented, would you have noticed?","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"33822f3ff0959d70d0262372dbf69e53946c8f77","unresolved":false,"context_lines":[{"line_number":381,"context_line":"      - Unable to allocate inventory"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"# This is a successful reshape using information as it was established above"},{"line_number":384,"context_line":"# or in the AllocationFixture. A non-obvious fact of this test is that it"},{"line_number":385,"context_line":"# confirms that resource provider and consumer generations are rolled back"},{"line_number":386,"context_line":"# when failures occur, as in the tests above."},{"line_number":387,"context_line":"- name: move vcpu inventory and allocations to child"},{"line_number":388,"context_line":"  POST: /reshaper"},{"line_number":389,"context_line":"  data:"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"5f7c97a3_5e95db86","line":386,"range":{"start_line":384,"start_character":31,"end_line":386,"end_character":45},"updated":"2018-07-19 15:11:23.000000000","message":"++ nice","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":56,"context_line":"              inventories:"},{"line_number":57,"context_line":"                  VCPU:"},{"line_number":58,"context_line":"                      total: 1"},{"line_number":59,"context_line":"      allocations: {}"},{"line_number":60,"context_line":"  status: 409"},{"line_number":61,"context_line":"  response_json_paths:"},{"line_number":62,"context_line":"      $.errors[0].code: placement.inventory.inuse"}],"source_content_type":"text/x-yaml","patch_set":12,"id":"5f7c97a3_d2c21386","line":59,"range":{"start_line":59,"start_character":6,"end_line":59,"end_character":21},"updated":"2018-07-21 15:51:24.000000000","message":"This is a little confusing to the casual reader because it could be construed to mean \"remove all allocations\", which would be a valid (if weird) thing. But to do that, you would actually need to say:\n\n allocations: {\n     consumer_uuid: {}\n     for consumer_uuid in all_consumers\n }\n\nkind of thing.\n\nNot suggesting a change, just musing to self.","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"99708dcaeaac0216755b842c14b1378d2a9673f3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"5f7c97a3_865a0a80","line":445,"updated":"2018-07-23 12:26:45.000000000","message":"As far as I understand non of the tests above creates a new consumer during reshape. I think we have to cover that case with test too.","commit_id":"60b0c28d49118ba6b0cd0d567baac5521015c686"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"612183e04b20e01c2177a0a36dd486be812d4900","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"5f7c97a3_c95ed3e7","line":445,"in_reply_to":"5f7c97a3_865a0a80","updated":"2018-07-23 12:37:08.000000000","message":"good point, I\u0027ll add one of those.\n\nThat functionality should be tested, I agree, but is that something we are actually thinking the reshaper will do? In my memory of the dicussions we were moving existing allocations for existing consumers.","commit_id":"60b0c28d49118ba6b0cd0d567baac5521015c686"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f21ce59940731b579c02da83ae685e6c5957da82","unresolved":false,"context_lines":[{"line_number":45,"context_line":"  status: 400"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# There are existing allocations on RP_UUID (created by the AllocationFixture)."},{"line_number":48,"context_line":"# As the code is currently we cannot null out those allocations from reshaper"},{"line_number":49,"context_line":"# because the allocations identify nothing (replace_all() is a no op)."},{"line_number":50,"context_line":"- name: empty allocations inv in use"},{"line_number":51,"context_line":"  POST: /reshaper"},{"line_number":52,"context_line":"  data:"}],"source_content_type":"text/x-yaml","patch_set":23,"id":"5f7c97a3_0e85d652","line":49,"range":{"start_line":48,"start_character":27,"end_line":49,"end_character":42},"updated":"2018-08-01 18:49:35.000000000","message":"I don\u0027t quite understand what this part of the comment means. could you clarify? What do you mean by \"the allocations identify nothing\"?\n\nDo you mean to say \"because the allocations dict has not keys -- where the expected keys are consumer UUIDs -- there is no identifiable information to delete allocation records\"?","commit_id":"323738628ae83b77fcf9b3db658e6e020e748637"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8801285f7d0a7579ce53a58efd98a81a46b4ff4d","unresolved":false,"context_lines":[{"line_number":45,"context_line":"  status: 400"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# There are existing allocations on RP_UUID (created by the AllocationFixture)."},{"line_number":48,"context_line":"# As the code is currently we cannot null out those allocations from reshaper"},{"line_number":49,"context_line":"# because the allocations identify nothing (replace_all() is a no op)."},{"line_number":50,"context_line":"- name: empty allocations inv in use"},{"line_number":51,"context_line":"  POST: /reshaper"},{"line_number":52,"context_line":"  data:"}],"source_content_type":"text/x-yaml","patch_set":23,"id":"5f7c97a3_5f0a99cf","line":49,"range":{"start_line":48,"start_character":27,"end_line":49,"end_character":42},"in_reply_to":"5f7c97a3_0e85d652","updated":"2018-08-01 21:17:50.000000000","message":"Yeah, without consumer ids (which are the keys), there\u0027s no way to identify records.\n\nI can reorder the words to make that more clear if people want that.","commit_id":"323738628ae83b77fcf9b3db658e6e020e748637"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f21ce59940731b579c02da83ae685e6c5957da82","unresolved":false,"context_lines":[{"line_number":65,"context_line":"# not INSTANCE_ID, when we try to allocate here, we don\u0027t have room. This"},{"line_number":66,"context_line":"# is a correctly invalid operation as to be actually reshaping here, we"},{"line_number":67,"context_line":"# would be needing to move the CONSUMER_ID allocations in this call (and"},{"line_number":68,"context_line":"# setting the inventory to something that could accomodate them)."},{"line_number":69,"context_line":"- name: with allocations"},{"line_number":70,"context_line":"  POST: /reshaper"},{"line_number":71,"context_line":"  data:"}],"source_content_type":"text/x-yaml","patch_set":23,"id":"5f7c97a3_ced11e58","line":68,"updated":"2018-08-01 18:49:35.000000000","message":"++","commit_id":"323738628ae83b77fcf9b3db658e6e020e748637"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f21ce59940731b579c02da83ae685e6c5957da82","unresolved":false,"context_lines":[{"line_number":382,"context_line":"# This is a successful reshape using information as it was established above"},{"line_number":383,"context_line":"# or in the AllocationFixture. A non-obvious fact of this test is that it"},{"line_number":384,"context_line":"# confirms that resource provider and consumer generations are rolled back"},{"line_number":385,"context_line":"# when failures occur, as in the tests above."},{"line_number":386,"context_line":"- name: move vcpu inventory and allocations to child"},{"line_number":387,"context_line":"  POST: /reshaper"},{"line_number":388,"context_line":"  data:"}],"source_content_type":"text/x-yaml","patch_set":23,"id":"5f7c97a3_ced27e33","line":385,"updated":"2018-08-01 18:49:35.000000000","message":"++, thanks for pointing out the non-obvious assertion.","commit_id":"323738628ae83b77fcf9b3db658e6e020e748637"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f21ce59940731b579c02da83ae685e6c5957da82","unresolved":false,"context_lines":[{"line_number":464,"context_line":"          $ENVIRON[\u0027ALT_RP_UUID\u0027]:"},{"line_number":465,"context_line":"              resource_provider_generation: 3"},{"line_number":466,"context_line":"              # bug https://bugs.launchpad.net/nova/+bug/1783130"},{"line_number":467,"context_line":"              # means that this will cause an IndexError."},{"line_number":468,"context_line":"              inventories: {}"},{"line_number":469,"context_line":"      # these consumer generations are all 1 because they have"},{"line_number":470,"context_line":"      # previously allocated"}],"source_content_type":"text/x-yaml","patch_set":23,"id":"5f7c97a3_6ea32ab1","line":467,"updated":"2018-08-01 18:49:35.000000000","message":"ack.","commit_id":"323738628ae83b77fcf9b3db658e6e020e748637"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"97a5f94b503941cb151879c0c407e91fa0543b30","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":119,"context_line":"                      resources:"},{"line_number":120,"context_line":"                          VCPU: 1"},{"line_number":121,"context_line":"              # The correct generation here is 0"},{"line_number":122,"context_line":"              consumer_generation: 99"},{"line_number":123,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":124,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"}],"source_content_type":"text/x-yaml","patch_set":24,"id":"5f7c97a3_4b6bb2b6","line":121,"range":{"start_line":121,"start_character":47,"end_line":121,"end_character":48},"updated":"2018-08-02 09:03:35.000000000","message":"Isn\u0027t it null as the instance_uuid is a new consumer?","commit_id":"262e881f24732bb3f9952d8d1d2def2778dfc890"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a02a227c221c87bc47d2d9c6f3347536872200cc","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":119,"context_line":"                      resources:"},{"line_number":120,"context_line":"                          VCPU: 1"},{"line_number":121,"context_line":"              # The correct generation here is 0"},{"line_number":122,"context_line":"              consumer_generation: 99"},{"line_number":123,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":124,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"}],"source_content_type":"text/x-yaml","patch_set":24,"id":"3f79a3b5_0f70fda4","line":121,"range":{"start_line":121,"start_character":47,"end_line":121,"end_character":48},"in_reply_to":"5f7c97a3_2d520612","updated":"2018-08-21 17:15:20.000000000","message":"Done","commit_id":"262e881f24732bb3f9952d8d1d2def2778dfc890"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"4b61b4ad7acbfe7dc7e67b829abbbaa48a08d17c","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":119,"context_line":"                      resources:"},{"line_number":120,"context_line":"                          VCPU: 1"},{"line_number":121,"context_line":"              # The correct generation here is 0"},{"line_number":122,"context_line":"              consumer_generation: 99"},{"line_number":123,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":124,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"}],"source_content_type":"text/x-yaml","patch_set":24,"id":"5f7c97a3_2d520612","line":121,"range":{"start_line":121,"start_character":47,"end_line":121,"end_character":48},"in_reply_to":"5f7c97a3_4b6bb2b6","updated":"2018-08-02 13:10:21.000000000","message":"I think you\u0027re right. This is probably a pasto generated while adjusting the tests somewhere in the iterations.","commit_id":"262e881f24732bb3f9952d8d1d2def2778dfc890"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5d3ab8d445c10ae7aec7d01c78dfb53d98cd8bfa","unresolved":false,"context_lines":[{"line_number":148,"context_line":"                      total: 2048"},{"line_number":149,"context_line":"                      step_size: 10"},{"line_number":150,"context_line":"                      min_unit: 10"},{"line_number":151,"context_line":"                      # this was 600 originally but we reset it to 1200"},{"line_number":152,"context_line":"                      # here because the fixture allocated twice for"},{"line_number":153,"context_line":"                      # the same consumer and we can\u0027t do that from"},{"line_number":154,"context_line":"                      # the api."},{"line_number":155,"context_line":"                      max_unit: 1200"},{"line_number":156,"context_line":"          # This resource provider does not exist."},{"line_number":157,"context_line":"          \u002739bafc00-3fff-444d-b87a-2ead3f866e05\u0027:"}],"source_content_type":"text/x-yaml","patch_set":24,"id":"5f7c97a3_2d944634","line":154,"range":{"start_line":151,"start_character":0,"end_line":154,"end_character":32},"updated":"2018-08-02 13:18:38.000000000","message":"TODO: unwind this and its brethren below when [1] merges (or fold [1] into this series).\n\n[1] https://review.openstack.org/#/c/588158/","commit_id":"262e881f24732bb3f9952d8d1d2def2778dfc890"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"97a5f94b503941cb151879c0c407e91fa0543b30","unresolved":false,"context_lines":[{"line_number":440,"context_line":"              user_id: $ENVIRON[\u0027ALT_USER_ID\u0027]"},{"line_number":441,"context_line":"              consumer_generation: 1"},{"line_number":442,"context_line":"  status: 204"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"# Now move some of the inventory back to the original provider, and put all"},{"line_number":445,"context_line":"# the allocations under two new consumers. This is an artificial test to"},{"line_number":446,"context_line":"# exercise new consumer creation."}],"source_content_type":"text/x-yaml","patch_set":24,"id":"5f7c97a3_ebc15e82","line":443,"updated":"2018-08-02 09:03:35.000000000","message":"I would check the inventories and allocations after the successful reshape","commit_id":"262e881f24732bb3f9952d8d1d2def2778dfc890"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"4b61b4ad7acbfe7dc7e67b829abbbaa48a08d17c","unresolved":false,"context_lines":[{"line_number":440,"context_line":"              user_id: $ENVIRON[\u0027ALT_USER_ID\u0027]"},{"line_number":441,"context_line":"              consumer_generation: 1"},{"line_number":442,"context_line":"  status: 204"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"# Now move some of the inventory back to the original provider, and put all"},{"line_number":445,"context_line":"# the allocations under two new consumers. This is an artificial test to"},{"line_number":446,"context_line":"# exercise new consumer creation."}],"source_content_type":"text/x-yaml","patch_set":24,"id":"5f7c97a3_eda5ee01","line":443,"in_reply_to":"5f7c97a3_ebc15e82","updated":"2018-08-02 13:10:21.000000000","message":"I think we\u0027ve talked about doing that in a follow up.\n\nThe reason I didn\u0027t do it originally was because we already have code that indicates that the backend works, assuming it gets good data for its parameters. What these tests are checking is that the code that calls the backend (and handles various error conditions) is working.\n\nIt\u0027s nice to duplicate that to add some confidence but it is redundant.","commit_id":"262e881f24732bb3f9952d8d1d2def2778dfc890"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"6543bac40a73562d38d2fed372444217e7872e85","unresolved":false,"context_lines":[{"line_number":440,"context_line":"              user_id: $ENVIRON[\u0027ALT_USER_ID\u0027]"},{"line_number":441,"context_line":"              consumer_generation: 1"},{"line_number":442,"context_line":"  status: 204"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"# Now move some of the inventory back to the original provider, and put all"},{"line_number":445,"context_line":"# the allocations under two new consumers. This is an artificial test to"},{"line_number":446,"context_line":"# exercise new consumer creation."}],"source_content_type":"text/x-yaml","patch_set":26,"id":"3f79a3b5_f1493f32","line":443,"updated":"2018-08-04 11:34:10.000000000","message":"Why not have here some usage checks?\n\n    - name: get usages on parent after move\n      GET: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/usages\n      response_json_paths:\n          $.usages:\n              DISK_GB: 1020\n          $.resource_provider_generation: 8\n\n    - name: get usages on child after move\n      GET: /resource_providers/$ENVIRON[\u0027ALT_RP_UUID\u0027]/usages\n      response_json_paths:\n          $.usages:\n              VCPU: 9\n          $.resource_provider_generation: 3","commit_id":"7965dad2b47b27c77dadefe9d35ba57a34f503cb"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a02a227c221c87bc47d2d9c6f3347536872200cc","unresolved":false,"context_lines":[{"line_number":440,"context_line":"              user_id: $ENVIRON[\u0027ALT_USER_ID\u0027]"},{"line_number":441,"context_line":"              consumer_generation: 1"},{"line_number":442,"context_line":"  status: 204"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"# Now move some of the inventory back to the original provider, and put all"},{"line_number":445,"context_line":"# the allocations under two new consumers. This is an artificial test to"},{"line_number":446,"context_line":"# exercise new consumer creation."}],"source_content_type":"text/x-yaml","patch_set":26,"id":"3f79a3b5_cf4a0526","line":443,"in_reply_to":"3f79a3b5_f1493f32","updated":"2018-08-21 17:15:20.000000000","message":"Done","commit_id":"7965dad2b47b27c77dadefe9d35ba57a34f503cb"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"6543bac40a73562d38d2fed372444217e7872e85","unresolved":false,"context_lines":[{"line_number":466,"context_line":"              # bug https://bugs.launchpad.net/nova/+bug/1783130"},{"line_number":467,"context_line":"              # means that this will cause an IndexError."},{"line_number":468,"context_line":"              inventories: {}"},{"line_number":469,"context_line":"      # these consumer generations are all 1 because they have"},{"line_number":470,"context_line":"      # previously allocated"},{"line_number":471,"context_line":"      allocations:"},{"line_number":472,"context_line":"          $ENVIRON[\u0027CONSUMER_0\u0027]:"},{"line_number":473,"context_line":"              allocations:"}],"source_content_type":"text/x-yaml","patch_set":26,"id":"3f79a3b5_11471b20","line":470,"range":{"start_line":469,"start_character":0,"end_line":470,"end_character":28},"updated":"2018-08-04 11:34:10.000000000","message":"Bad copy and paste","commit_id":"7965dad2b47b27c77dadefe9d35ba57a34f503cb"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a02a227c221c87bc47d2d9c6f3347536872200cc","unresolved":false,"context_lines":[{"line_number":466,"context_line":"              # bug https://bugs.launchpad.net/nova/+bug/1783130"},{"line_number":467,"context_line":"              # means that this will cause an IndexError."},{"line_number":468,"context_line":"              inventories: {}"},{"line_number":469,"context_line":"      # these consumer generations are all 1 because they have"},{"line_number":470,"context_line":"      # previously allocated"},{"line_number":471,"context_line":"      allocations:"},{"line_number":472,"context_line":"          $ENVIRON[\u0027CONSUMER_0\u0027]:"},{"line_number":473,"context_line":"              allocations:"}],"source_content_type":"text/x-yaml","patch_set":26,"id":"3f79a3b5_0fcc7dba","line":470,"range":{"start_line":469,"start_character":0,"end_line":470,"end_character":28},"in_reply_to":"3f79a3b5_11471b20","updated":"2018-08-21 17:15:20.000000000","message":"Done (at PS27)","commit_id":"7965dad2b47b27c77dadefe9d35ba57a34f503cb"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"6543bac40a73562d38d2fed372444217e7872e85","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":26,"id":"3f79a3b5_715f6fe5","line":498,"updated":"2018-08-04 11:34:10.000000000","message":"Good to have usage check here, too.\n\n    - name: get usages on parent after move back\n      GET: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/usages\n      response_json_paths:\n          $.usages:\n              VCPU: 9\n              DISK_GB: 1040\n          $.resource_provider_generation: 11\n\n    - name: get usages on child after move back\n      GET: /resource_providers/$ENVIRON[\u0027ALT_RP_UUID\u0027]/usages\n      response_json_paths:\n          $.usages: {}\n          $.resource_provider_generation: 5","commit_id":"7965dad2b47b27c77dadefe9d35ba57a34f503cb"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a02a227c221c87bc47d2d9c6f3347536872200cc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":26,"id":"3f79a3b5_ef458116","line":498,"in_reply_to":"3f79a3b5_715f6fe5","updated":"2018-08-21 17:15:20.000000000","message":"Done","commit_id":"7965dad2b47b27c77dadefe9d35ba57a34f503cb"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3da6ec0bbf6c05a57f4afc80a6a0cd241ad3e328","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":119,"context_line":"                      resources:"},{"line_number":120,"context_line":"                          VCPU: 1"},{"line_number":121,"context_line":"              # The correct generation here is 0"},{"line_number":122,"context_line":"              consumer_generation: 99"},{"line_number":123,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":124,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"}],"source_content_type":"text/x-yaml","patch_set":27,"id":"3f79a3b5_1a546f20","line":121,"range":{"start_line":121,"start_character":47,"end_line":121,"end_character":48},"updated":"2018-08-13 13:46:27.000000000","message":"nit: null","commit_id":"9530c9af44406f37599e2b5b76f78bfdb8af116d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a02a227c221c87bc47d2d9c6f3347536872200cc","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                  $ENVIRON[\u0027RP_UUID\u0027]:"},{"line_number":119,"context_line":"                      resources:"},{"line_number":120,"context_line":"                          VCPU: 1"},{"line_number":121,"context_line":"              # The correct generation here is 0"},{"line_number":122,"context_line":"              consumer_generation: 99"},{"line_number":123,"context_line":"              project_id: $ENVIRON[\u0027PROJECT_ID\u0027]"},{"line_number":124,"context_line":"              user_id: $ENVIRON[\u0027USER_ID\u0027]"}],"source_content_type":"text/x-yaml","patch_set":27,"id":"3f79a3b5_efc6e149","line":121,"range":{"start_line":121,"start_character":47,"end_line":121,"end_character":48},"in_reply_to":"3f79a3b5_1a546f20","updated":"2018-08-21 17:15:20.000000000","message":"Done","commit_id":"9530c9af44406f37599e2b5b76f78bfdb8af116d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# /reshaper provides a way to atomically move inventory and allocations from"},{"line_number":2,"context_line":"# one resource provider to another, often from a root provide to a new child."},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"fixtures:"},{"line_number":5,"context_line":"    - AllocationFixture"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_01d98d55","line":2,"range":{"start_line":2,"start_character":54,"end_line":2,"end_character":61},"updated":"2018-08-22 18:10:19.000000000","message":"provider","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"defaults:"},{"line_number":8,"context_line":"    request_headers:"},{"line_number":9,"context_line":"        x-auth-token: admin"},{"line_number":10,"context_line":"        accept: application/json"},{"line_number":11,"context_line":"        content-type: application/json"},{"line_number":12,"context_line":"        openstack-api-version: placement 1.30"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_e1bc91dd","line":9,"range":{"start_line":9,"start_character":22,"end_line":9,"end_character":27},"updated":"2018-08-22 18:10:19.000000000","message":"Regarding that policy comment, I\u0027m guessing if this is a non-admin for the POST /reshaper calls it would pass, although it should fail by default for non-admins.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"defaults:"},{"line_number":8,"context_line":"    request_headers:"},{"line_number":9,"context_line":"        x-auth-token: admin"},{"line_number":10,"context_line":"        accept: application/json"},{"line_number":11,"context_line":"        content-type: application/json"},{"line_number":12,"context_line":"        openstack-api-version: placement 1.30"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_f08f7520","line":9,"range":{"start_line":9,"start_character":22,"end_line":9,"end_character":27},"in_reply_to":"3f79a3b5_dfa60c10","updated":"2018-08-22 21:37:53.000000000","message":"Done","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"defaults:"},{"line_number":8,"context_line":"    request_headers:"},{"line_number":9,"context_line":"        x-auth-token: admin"},{"line_number":10,"context_line":"        accept: application/json"},{"line_number":11,"context_line":"        content-type: application/json"},{"line_number":12,"context_line":"        openstack-api-version: placement 1.30"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_dfa60c10","line":9,"range":{"start_line":9,"start_character":22,"end_line":9,"end_character":27},"in_reply_to":"3f79a3b5_e1bc91dd","updated":"2018-08-22 19:06:52.000000000","message":"Yeah, will make a test that confirms that.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":258,"context_line":"              consumer_generation: 1"},{"line_number":259,"context_line":"  status: 400"},{"line_number":260,"context_line":"  response_strings:"},{"line_number":261,"context_line":"      - JSON does not validate"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"- name: poorly formed allocation 400"},{"line_number":264,"context_line":"  POST: /reshaper"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_a180d9f8","line":261,"updated":"2018-08-22 18:10:19.000000000","message":"Is it possible to regex assert that \"bad_field\" is in the error output as the offending field?","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":258,"context_line":"              consumer_generation: 1"},{"line_number":259,"context_line":"  status: 400"},{"line_number":260,"context_line":"  response_strings:"},{"line_number":261,"context_line":"      - JSON does not validate"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"- name: poorly formed allocation 400"},{"line_number":264,"context_line":"  POST: /reshaper"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_f0dd3514","line":261,"in_reply_to":"3f79a3b5_a180d9f8","updated":"2018-08-22 21:37:53.000000000","message":"you can check for any string fragments but not full regexes, so yes, but I\u0027ve tried to avoid making the gabbi test all of that kind of thing. In the sense that if we want to test that our error handling does what we think it supposed to, a unit test might be better. in a gabbi test it is kind of noise.\n\nI\u0027ll add one here because it helps to confirm that the error that we think we are causing its actually it, and we can decide if we want similar things throughout.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f3c16d50e12352e4f2d54e9d962edccd3a000ff3","unresolved":false,"context_lines":[{"line_number":258,"context_line":"              consumer_generation: 1"},{"line_number":259,"context_line":"  status: 400"},{"line_number":260,"context_line":"  response_strings:"},{"line_number":261,"context_line":"      - JSON does not validate"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"- name: poorly formed allocation 400"},{"line_number":264,"context_line":"  POST: /reshaper"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_bc71d778","line":261,"in_reply_to":"3f79a3b5_f0dd3514","updated":"2018-08-23 00:29:11.000000000","message":"\u003e I\u0027ll add one here because it helps to confirm that the error that we think we are causing its actually it\n\nYeah that\u0027s exactly why I ask for these types of assertions in API handler tests because we could be getting the error for something else and the test is busted.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":320,"context_line":"              consumer_generation: 1"},{"line_number":321,"context_line":"  status: 400"},{"line_number":322,"context_line":"  response_strings:"},{"line_number":323,"context_line":"      - JSON does not validate"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"- name: move bad allocation 409"},{"line_number":326,"context_line":"  desc: max unit on disk gb inventory violated"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_c185d508","line":323,"updated":"2018-08-22 18:10:19.000000000","message":"same re bad_field","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"2ff846f4edbb8b36968cd5d81fb33cbc74316c7f","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                      total: 2048"},{"line_number":217,"context_line":"                      step_size: 10"},{"line_number":218,"context_line":"                      min_unit: 10"},{"line_number":219,"context_line":"                      # this was 600 originally but we reset it to 1200"},{"line_number":220,"context_line":"                      # here because the fixture allocated twice for"},{"line_number":221,"context_line":"                      # the same consumer and we can\u0027t do that from"},{"line_number":222,"context_line":"                      # the api."},{"line_number":223,"context_line":"                      max_unit: 1200"},{"line_number":224,"context_line":"                      bad_field: moo"},{"line_number":225,"context_line":"          $ENVIRON[\u0027ALT_RP_UUID\u0027]:"}],"source_content_type":"text/x-yaml","patch_set":35,"id":"3f79a3b5_36afc27d","line":222,"range":{"start_line":219,"start_character":0,"end_line":222,"end_character":32},"updated":"2018-08-28 02:06:04.000000000","message":"It is 1000 originally... and the twice allocation for the same consumer has been removed now.\n\nThe same can be said in the following CPU inventory and the following comments.","commit_id":"4d525b4ec1afbcfb93c93a19ccdc452af2ad0ebc"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a85f914f5e698f3c71b86127e6e3da19e4d1a787","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                      total: 2048"},{"line_number":217,"context_line":"                      step_size: 10"},{"line_number":218,"context_line":"                      min_unit: 10"},{"line_number":219,"context_line":"                      # this was 600 originally but we reset it to 1200"},{"line_number":220,"context_line":"                      # here because the fixture allocated twice for"},{"line_number":221,"context_line":"                      # the same consumer and we can\u0027t do that from"},{"line_number":222,"context_line":"                      # the api."},{"line_number":223,"context_line":"                      max_unit: 1200"},{"line_number":224,"context_line":"                      bad_field: moo"},{"line_number":225,"context_line":"          $ENVIRON[\u0027ALT_RP_UUID\u0027]:"}],"source_content_type":"text/x-yaml","patch_set":35,"id":"3f79a3b5_7181af4d","line":222,"range":{"start_line":219,"start_character":0,"end_line":222,"end_character":32},"in_reply_to":"3f79a3b5_36afc27d","updated":"2018-08-28 19:49:29.000000000","message":"I think the thing to do is to simply remove the comments throughout, right? I could have gone through and seen whether keeping the original max_unit would work or break the test, but considering we would need to specify it anyway (else it would get the default, as opposed to remaining unchanged) it wouldn\u0027t save us anything.\n\nhttps://review.openstack.org/597220","commit_id":"4d525b4ec1afbcfb93c93a19ccdc452af2ad0ebc"}],"placement-api-ref/source/parameters.yaml":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":380,"context_line":"  type: object"},{"line_number":381,"context_line":"  in: body"},{"line_number":382,"context_line":"  required: true"},{"line_number":383,"context_line":"  min_version: 1.30"},{"line_number":384,"context_line":"  description: \u003e"},{"line_number":385,"context_line":"    An optionally empty dictionary of multiple allocations, keyed by consumer"},{"line_number":386,"context_line":"    uuid. Each collection of allocations describes the full set of allocations"}],"source_content_type":"text/x-yaml","patch_set":12,"id":"5f7c97a3_323d878c","line":383,"range":{"start_line":383,"start_character":0,"end_line":383,"end_character":19},"updated":"2018-07-21 15:51:24.000000000","message":"strike","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d7334c7d1b19d54f3638bfed0196dc8af7499b31","unresolved":false,"context_lines":[{"line_number":380,"context_line":"  type: object"},{"line_number":381,"context_line":"  in: body"},{"line_number":382,"context_line":"  required: true"},{"line_number":383,"context_line":"  min_version: 1.30"},{"line_number":384,"context_line":"  description: \u003e"},{"line_number":385,"context_line":"    An optionally empty dictionary of multiple allocations, keyed by consumer"},{"line_number":386,"context_line":"    uuid. Each collection of allocations describes the full set of allocations"}],"source_content_type":"text/x-yaml","patch_set":12,"id":"5f7c97a3_b2d8b7ec","line":383,"range":{"start_line":383,"start_character":0,"end_line":383,"end_character":19},"in_reply_to":"5f7c97a3_12a40bb7","updated":"2018-07-21 17:37:44.000000000","message":"My beef was based on how this renders [1]. The top of the Reshaper section says the operation is available starting at 1.30, so it doesn\u0027t make sense when the fields (in fact some of them, but not all of them, which makes it more worser and confusinger) say \"New in version 1.30\".\n\nIf we want to highlight to the reader of this source file that these are new in 1.30, we can use a comment. Or go off and write some sphinx cleverness that automagically avoids injecting that text if it\u0027s already marked on the parent.\n\n[1] http://logs.openstack.org/27/576927/12/check/build-placement-api-ref/119e96a/html/#reshaper","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"073289ef45452a61489ef766dc01b2f14b1ce09c","unresolved":false,"context_lines":[{"line_number":380,"context_line":"  type: object"},{"line_number":381,"context_line":"  in: body"},{"line_number":382,"context_line":"  required: true"},{"line_number":383,"context_line":"  min_version: 1.30"},{"line_number":384,"context_line":"  description: \u003e"},{"line_number":385,"context_line":"    An optionally empty dictionary of multiple allocations, keyed by consumer"},{"line_number":386,"context_line":"    uuid. Each collection of allocations describes the full set of allocations"}],"source_content_type":"text/x-yaml","patch_set":12,"id":"5f7c97a3_12a40bb7","line":383,"range":{"start_line":383,"start_character":0,"end_line":383,"end_character":19},"in_reply_to":"5f7c97a3_323d878c","updated":"2018-07-21 16:29:11.000000000","message":"are we only using these when an existing thing changes?\n\nit\u0027s a sad loss of metadata","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":389,"context_line":"  type: object"},{"line_number":390,"context_line":"  in: body"},{"line_number":391,"context_line":"  required: true"},{"line_number":392,"context_line":"  min_version: 1.30"},{"line_number":393,"context_line":"  description: \u003e"},{"line_number":394,"context_line":"    A dictionary of multiple inventories, keyed by resource provider uuid. Each"},{"line_number":395,"context_line":"    inventory describes the desired full inventory for each resource provider."}],"source_content_type":"text/x-yaml","patch_set":12,"id":"5f7c97a3_d247731d","line":392,"range":{"start_line":392,"start_character":0,"end_line":392,"end_character":19},"updated":"2018-07-21 15:51:24.000000000","message":"strike","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f484225c67ef36cff626682af2cde545669e455c","unresolved":false,"context_lines":[{"line_number":401,"context_line":"  description: \u003e"},{"line_number":402,"context_line":"    An optionally empty dictionary of multiple allocations, keyed by consumer"},{"line_number":403,"context_line":"    uuid. Each collection of allocations describes the full set of allocations"},{"line_number":404,"context_line":"    for this consumer."},{"line_number":405,"context_line":"reshaper_inventories:"},{"line_number":406,"context_line":"  type: object"},{"line_number":407,"context_line":"  in: body"}],"source_content_type":"text/x-yaml","patch_set":28,"id":"3f79a3b5_44273acb","line":404,"updated":"2018-08-15 15:21:37.000000000","message":"It would be useful to indicate what an empty dictionary means here.","commit_id":"b99a5d937c73b9e764ac9dac84dc8a04b2561fbe"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a02a227c221c87bc47d2d9c6f3347536872200cc","unresolved":false,"context_lines":[{"line_number":401,"context_line":"  description: \u003e"},{"line_number":402,"context_line":"    An optionally empty dictionary of multiple allocations, keyed by consumer"},{"line_number":403,"context_line":"    uuid. Each collection of allocations describes the full set of allocations"},{"line_number":404,"context_line":"    for this consumer."},{"line_number":405,"context_line":"reshaper_inventories:"},{"line_number":406,"context_line":"  type: object"},{"line_number":407,"context_line":"  in: body"}],"source_content_type":"text/x-yaml","patch_set":28,"id":"3f79a3b5_0fb8fd73","line":404,"in_reply_to":"3f79a3b5_44273acb","updated":"2018-08-21 17:15:20.000000000","message":"Good call, done.","commit_id":"b99a5d937c73b9e764ac9dac84dc8a04b2561fbe"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":399,"context_line":"  in: body"},{"line_number":400,"context_line":"  required: true"},{"line_number":401,"context_line":"  description: \u003e"},{"line_number":402,"context_line":"    A dictionary of multiple allocations, keyed by consumer uuid. Each"},{"line_number":403,"context_line":"    collection of allocations describes the full set of allocations for this"},{"line_number":404,"context_line":"    consumer. An empty dictionary indicates no change in existing allocations,"},{"line_number":405,"context_line":"    whereas an empty ``allocations`` dictionary **within** a consumer"},{"line_number":406,"context_line":"    dictionary indicates that all allocations for that consumer should be"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_418c65d6","line":403,"range":{"start_line":402,"start_character":66,"end_line":403,"end_character":67},"updated":"2018-08-22 18:10:19.000000000","message":"From the description, it\u0027s not immediately obvious that each allocation dict is keyed by resource provider uuid, you have to glean that from the sample. Since we\u0027re kind of copying POST /allocations here, maybe we can work in some of the description for the \"allocations\" parameter in that API, which is:\n\n\"A dictionary of resource allocations keyed by resource provider uuid. If this is an empty object, allocations for this consumer will be removed.\"\n\nSo maybe something like:\n\n\"A dictionary of multiple allocations, keyed by consumer uuid. Each collection of allocations describes the full set of allocations for each consumer. Each consumer allocations dict is itself a dictionary of resource allocations keyed by resource provider uuid.\"...then talk about what empty means.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":400,"context_line":"  required: true"},{"line_number":401,"context_line":"  description: \u003e"},{"line_number":402,"context_line":"    A dictionary of multiple allocations, keyed by consumer uuid. Each"},{"line_number":403,"context_line":"    collection of allocations describes the full set of allocations for this"},{"line_number":404,"context_line":"    consumer. An empty dictionary indicates no change in existing allocations,"},{"line_number":405,"context_line":"    whereas an empty ``allocations`` dictionary **within** a consumer"},{"line_number":406,"context_line":"    dictionary indicates that all allocations for that consumer should be"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_a1fc5972","line":403,"range":{"start_line":403,"start_character":72,"end_line":403,"end_character":76},"updated":"2018-08-22 18:10:19.000000000","message":"each?","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":399,"context_line":"  in: body"},{"line_number":400,"context_line":"  required: true"},{"line_number":401,"context_line":"  description: \u003e"},{"line_number":402,"context_line":"    A dictionary of multiple allocations, keyed by consumer uuid. Each"},{"line_number":403,"context_line":"    collection of allocations describes the full set of allocations for this"},{"line_number":404,"context_line":"    consumer. An empty dictionary indicates no change in existing allocations,"},{"line_number":405,"context_line":"    whereas an empty ``allocations`` dictionary **within** a consumer"},{"line_number":406,"context_line":"    dictionary indicates that all allocations for that consumer should be"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_1068f11a","line":403,"range":{"start_line":402,"start_character":66,"end_line":403,"end_character":67},"in_reply_to":"3f79a3b5_418c65d6","updated":"2018-08-22 21:37:53.000000000","message":"Done","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":399,"context_line":"  in: body"},{"line_number":400,"context_line":"  required: true"},{"line_number":401,"context_line":"  description: \u003e"},{"line_number":402,"context_line":"    A dictionary of multiple allocations, keyed by consumer uuid. Each"},{"line_number":403,"context_line":"    collection of allocations describes the full set of allocations for this"},{"line_number":404,"context_line":"    consumer. An empty dictionary indicates no change in existing allocations,"},{"line_number":405,"context_line":"    whereas an empty ``allocations`` dictionary **within** a consumer"},{"line_number":406,"context_line":"    dictionary indicates that all allocations for that consumer should be"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_df236ca6","line":403,"range":{"start_line":402,"start_character":66,"end_line":403,"end_character":67},"in_reply_to":"3f79a3b5_418c65d6","updated":"2018-08-22 19:06:52.000000000","message":"i\u0027ll give it a whirl","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":404,"context_line":"    consumer. An empty dictionary indicates no change in existing allocations,"},{"line_number":405,"context_line":"    whereas an empty ``allocations`` dictionary **within** a consumer"},{"line_number":406,"context_line":"    dictionary indicates that all allocations for that consumer should be"},{"line_number":407,"context_line":"    deleted."},{"line_number":408,"context_line":"reshaper_inventories:"},{"line_number":409,"context_line":"  type: object"},{"line_number":410,"context_line":"  in: body"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_613f2125","line":407,"updated":"2018-08-22 18:10:19.000000000","message":"Could note that the latter is the same behavior as in ``POST /allocations`` but maybe that gets overly wordy and confusing since users would then maybe need to cross-reference what POST /allocations does. So this is good enough.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":404,"context_line":"    consumer. An empty dictionary indicates no change in existing allocations,"},{"line_number":405,"context_line":"    whereas an empty ``allocations`` dictionary **within** a consumer"},{"line_number":406,"context_line":"    dictionary indicates that all allocations for that consumer should be"},{"line_number":407,"context_line":"    deleted."},{"line_number":408,"context_line":"reshaper_inventories:"},{"line_number":409,"context_line":"  type: object"},{"line_number":410,"context_line":"  in: body"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_5f167c4b","line":407,"in_reply_to":"3f79a3b5_613f2125","updated":"2018-08-22 19:06:52.000000000","message":"Yeah, I agree that could get messy.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":410,"context_line":"  in: body"},{"line_number":411,"context_line":"  required: true"},{"line_number":412,"context_line":"  description: \u003e"},{"line_number":413,"context_line":"    A dictionary of multiple inventories, keyed by resource provider uuid. Each"},{"line_number":414,"context_line":"    inventory describes the desired full inventory for each resource provider."},{"line_number":415,"context_line":"resource_class:"},{"line_number":416,"context_line":"  \u003c\u003c: *resource_class_path"},{"line_number":417,"context_line":"  in: body"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_a10a1976","line":414,"range":{"start_line":413,"start_character":4,"end_line":414,"end_character":78},"updated":"2018-08-22 18:10:19.000000000","message":"Do you want to mention anything in here about clearing the inventory for a given provider? i.e. bug 1783130.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":410,"context_line":"  in: body"},{"line_number":411,"context_line":"  required: true"},{"line_number":412,"context_line":"  description: \u003e"},{"line_number":413,"context_line":"    A dictionary of multiple inventories, keyed by resource provider uuid. Each"},{"line_number":414,"context_line":"    inventory describes the desired full inventory for each resource provider."},{"line_number":415,"context_line":"resource_class:"},{"line_number":416,"context_line":"  \u003c\u003c: *resource_class_path"},{"line_number":417,"context_line":"  in: body"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_508c29d6","line":414,"range":{"start_line":413,"start_character":4,"end_line":414,"end_character":78},"in_reply_to":"3f79a3b5_7a2586c1","updated":"2018-08-22 21:37:53.000000000","message":"Done","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":410,"context_line":"  in: body"},{"line_number":411,"context_line":"  required: true"},{"line_number":412,"context_line":"  description: \u003e"},{"line_number":413,"context_line":"    A dictionary of multiple inventories, keyed by resource provider uuid. Each"},{"line_number":414,"context_line":"    inventory describes the desired full inventory for each resource provider."},{"line_number":415,"context_line":"resource_class:"},{"line_number":416,"context_line":"  \u003c\u003c: *resource_class_path"},{"line_number":417,"context_line":"  in: body"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_ff9bc8c5","line":414,"range":{"start_line":413,"start_character":4,"end_line":414,"end_character":78},"in_reply_to":"3f79a3b5_a10a1976","updated":"2018-08-22 19:06:52.000000000","message":"do we? can we assume that once someone has decided they want to use reshaper (which I hope no human will find themselves wanting to do, but hey, people do weird things) they know what that can change about inventories?","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f3c16d50e12352e4f2d54e9d962edccd3a000ff3","unresolved":false,"context_lines":[{"line_number":410,"context_line":"  in: body"},{"line_number":411,"context_line":"  required: true"},{"line_number":412,"context_line":"  description: \u003e"},{"line_number":413,"context_line":"    A dictionary of multiple inventories, keyed by resource provider uuid. Each"},{"line_number":414,"context_line":"    inventory describes the desired full inventory for each resource provider."},{"line_number":415,"context_line":"resource_class:"},{"line_number":416,"context_line":"  \u003c\u003c: *resource_class_path"},{"line_number":417,"context_line":"  in: body"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_9cf97bc9","line":414,"range":{"start_line":413,"start_character":4,"end_line":414,"end_character":78},"in_reply_to":"3f79a3b5_ff9bc8c5","updated":"2018-08-23 00:29:11.000000000","message":"\u003e do we? can we assume that once someone has decided they want to use\n \u003e reshaper (which I hope no human will find themselves wanting to do,\n \u003e but hey, people do weird things) they know what that can change\n \u003e about inventories?\n\nI wouldn\u0027t assume that - people would likely have to read the code if that were the case, which sucks. Plus, I as a consumer of this via nova client-side code would rather read a nice API reference description than have to read the code everytime I need to have a quick understanding of what this does again.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8e153974877d444eabb1dd8b26c01b3a3f34ab7b","unresolved":false,"context_lines":[{"line_number":410,"context_line":"  in: body"},{"line_number":411,"context_line":"  required: true"},{"line_number":412,"context_line":"  description: \u003e"},{"line_number":413,"context_line":"    A dictionary of multiple inventories, keyed by resource provider uuid. Each"},{"line_number":414,"context_line":"    inventory describes the desired full inventory for each resource provider."},{"line_number":415,"context_line":"resource_class:"},{"line_number":416,"context_line":"  \u003c\u003c: *resource_class_path"},{"line_number":417,"context_line":"  in: body"}],"source_content_type":"text/x-yaml","patch_set":33,"id":"3f79a3b5_7a2586c1","line":414,"range":{"start_line":413,"start_character":4,"end_line":414,"end_character":78},"in_reply_to":"3f79a3b5_ff9bc8c5","updated":"2018-08-22 20:18:26.000000000","message":"Could add, \"An empty dictionary causes the inventory for that provider to be deleted.\" But it sounds kind of obvious now that I see it written down. Meh.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"}],"placement-api-ref/source/reshaper.inc":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"33822f3ff0959d70d0262372dbf69e53946c8f77","unresolved":false,"context_lines":[{"line_number":13,"context_line":"provider to a new child provider."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":16,"context_line":"          where the resource provider topology of a single physical resource"},{"line_number":17,"context_line":"          has changed. It has the potential to be slow and to lock several"},{"line_number":18,"context_line":"          database tables."},{"line_number":19,"context_line":""}],"source_content_type":"text/x-c++src","patch_set":11,"id":"5f7c97a3_bec8afa6","line":16,"range":{"start_line":16,"start_character":52,"end_line":16,"end_character":67},"updated":"2018-07-19 15:11:23.000000000","message":"ditto","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e119e1bff2fc3839ace30407ac464836ca322c00","unresolved":false,"context_lines":[{"line_number":13,"context_line":"provider to a new child provider."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":16,"context_line":"          where the resource provider topology of a single physical resource"},{"line_number":17,"context_line":"          has changed. It has the potential to be slow and to lock several"},{"line_number":18,"context_line":"          database tables."},{"line_number":19,"context_line":""}],"source_content_type":"text/x-c++src","patch_set":11,"id":"5f7c97a3_bde97e19","line":16,"range":{"start_line":16,"start_character":52,"end_line":16,"end_character":67},"in_reply_to":"5f7c97a3_bec8afa6","updated":"2018-07-20 10:46:01.000000000","message":"Done","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":28,"context_line":".. rest_parameters:: parameters.yaml"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"  - inventories: reshaper_inventories"},{"line_number":31,"context_line":"  - inventories.{uuid}.resource_provider_generation: resource_provider_generation"},{"line_number":32,"context_line":"  - inventories.{uuid}.inventories: inventories"},{"line_number":33,"context_line":"  - allocations: reshaper_allocations"},{"line_number":34,"context_line":"  - allocations.{uuid}.allocations: allocations_dict_empty"},{"line_number":35,"context_line":"  - allocations.{uuid}.allocations.{uuid}.resources: resources"}],"source_content_type":"text/x-c++src","patch_set":12,"id":"5f7c97a3_7260dfa4","line":32,"range":{"start_line":31,"start_character":0,"end_line":32,"end_character":47},"updated":"2018-07-21 15:51:24.000000000","message":"I wonder if these are necessary / a good idea, as opposed to linking to the PUT /resource_providers/{uuid}/inventories description.\n\nSimilar for allocations.","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"073289ef45452a61489ef766dc01b2f14b1ce09c","unresolved":false,"context_lines":[{"line_number":28,"context_line":".. rest_parameters:: parameters.yaml"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"  - inventories: reshaper_inventories"},{"line_number":31,"context_line":"  - inventories.{uuid}.resource_provider_generation: resource_provider_generation"},{"line_number":32,"context_line":"  - inventories.{uuid}.inventories: inventories"},{"line_number":33,"context_line":"  - allocations: reshaper_allocations"},{"line_number":34,"context_line":"  - allocations.{uuid}.allocations: allocations_dict_empty"},{"line_number":35,"context_line":"  - allocations.{uuid}.allocations.{uuid}.resources: resources"}],"source_content_type":"text/x-c++src","patch_set":12,"id":"5f7c97a3_d291b354","line":32,"range":{"start_line":31,"start_character":0,"end_line":32,"end_character":47},"in_reply_to":"5f7c97a3_7260dfa4","updated":"2018-07-21 16:29:11.000000000","message":"I couldn\u0027t decide either, but I chose to copy it from a few things in nova that do it  because the structure is complicated and this shows the nesting","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"626ff9fb903aed3c5ccca91817cfadff0e4a5037","unresolved":false,"context_lines":[{"line_number":35,"context_line":"  - allocations.{uuid}.allocations.{uuid}.resources: resources"},{"line_number":36,"context_line":"  - allocations.{uuid}.project_id: project_id_body"},{"line_number":37,"context_line":"  - allocations.{uuid}.user_id: user_id_body"},{"line_number":38,"context_line":"  - allocations.{uuid}.consumer_generation: consumer_generation"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"Request Example"},{"line_number":41,"context_line":"---------------"}],"source_content_type":"text/x-c++src","patch_set":12,"id":"5f7c97a3_f242af0c","line":38,"range":{"start_line":38,"start_character":44,"end_line":38,"end_character":63},"updated":"2018-07-21 15:51:24.000000000","message":"Shouldn\u0027t reuse this as it shows min_version 1.28.\n\nhttp://logs.openstack.org/27/576927/12/check/build-placement-api-ref/119e96a/html/#reshaper","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"073289ef45452a61489ef766dc01b2f14b1ce09c","unresolved":false,"context_lines":[{"line_number":35,"context_line":"  - allocations.{uuid}.allocations.{uuid}.resources: resources"},{"line_number":36,"context_line":"  - allocations.{uuid}.project_id: project_id_body"},{"line_number":37,"context_line":"  - allocations.{uuid}.user_id: user_id_body"},{"line_number":38,"context_line":"  - allocations.{uuid}.consumer_generation: consumer_generation"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"Request Example"},{"line_number":41,"context_line":"---------------"}],"source_content_type":"text/x-c++src","patch_set":12,"id":"5f7c97a3_f28cef39","line":38,"range":{"start_line":38,"start_character":44,"end_line":38,"end_character":63},"in_reply_to":"5f7c97a3_f242af0c","updated":"2018-07-21 16:29:11.000000000","message":"k","commit_id":"dde9cf16d92c5ffccdd88a1483c2308c3a8ddb2f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f21ce59940731b579c02da83ae685e6c5957da82","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":".. note:: This is a special operation that should only be used in rare cases"},{"line_number":16,"context_line":"          of resource provider topology changing when inventory is in use."},{"line_number":17,"context_line":"          Only use this if you are really sure of what you are doing."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":".. rest_method:: POST /reshaper"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-c++src","patch_set":23,"id":"5f7c97a3_ee965a4a","line":17,"updated":"2018-08-01 18:49:35.000000000","message":"++","commit_id":"323738628ae83b77fcf9b3db658e6e020e748637"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":2,"context_line":"Reshaper"},{"line_number":3,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":".. note:: Reshaper requests are available starting from version 1.30."},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Reshaper"},{"line_number":8,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-c++src","patch_set":33,"id":"3f79a3b5_4149c5b4","line":5,"range":{"start_line":5,"start_character":0,"end_line":5,"end_character":9},"updated":"2018-08-22 18:10:19.000000000","message":"nit: we don\u0027t make a similar note format for POST /allocations in 1.13:\n\nhttps://developer.openstack.org/api-ref/placement/#manage-allocations\n\nWe just highlight it in bold:\n\n**Available as of microversion 1.13.**\n\nCould be nice to be consistent in the formatting, but not a huge deal.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":2,"context_line":"Reshaper"},{"line_number":3,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":".. note:: Reshaper requests are available starting from version 1.30."},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Reshaper"},{"line_number":8,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-c++src","patch_set":33,"id":"3f79a3b5_e4633f19","line":5,"range":{"start_line":5,"start_character":0,"end_line":5,"end_character":9},"in_reply_to":"3f79a3b5_4149c5b4","updated":"2018-08-22 19:06:52.000000000","message":"We\u0027ve got both, see https://developer.openstack.org/api-ref/placement/#resource-provider-traits as an example\n\nI believe there have been efforts to fix it, but it languished on the \"other\" section of the pupdates for a long time without review.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f3c16d50e12352e4f2d54e9d962edccd3a000ff3","unresolved":false,"context_lines":[{"line_number":2,"context_line":"Reshaper"},{"line_number":3,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":".. note:: Reshaper requests are available starting from version 1.30."},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Reshaper"},{"line_number":8,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-c++src","patch_set":33,"id":"3f79a3b5_bcf6b7d6","line":5,"range":{"start_line":5,"start_character":0,"end_line":5,"end_character":9},"in_reply_to":"3f79a3b5_e4633f19","updated":"2018-08-23 00:29:11.000000000","message":"Ah OK, yeah whatever, this is fine. The compute API reference is a garbled mess of the same type of issue. Since placement API reference is a smaller footprint I figured staying consistent would be easier, but it slips by easily.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":28,"context_line":".. rest_parameters:: parameters.yaml"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"  - inventories: reshaper_inventories"},{"line_number":31,"context_line":"  - inventories.{uuid}.resource_provider_generation: resource_provider_generation"},{"line_number":32,"context_line":"  - inventories.{uuid}.inventories: inventories"},{"line_number":33,"context_line":"  - allocations: reshaper_allocations"},{"line_number":34,"context_line":"  - allocations.{uuid}.allocations: allocations_dict_empty"}],"source_content_type":"text/x-c++src","patch_set":33,"id":"3f79a3b5_21fa8942","line":31,"range":{"start_line":31,"start_character":16,"end_line":31,"end_character":23},"updated":"2018-08-22 18:10:19.000000000","message":"This must be a new style of formatting for the API reference? I mean I get it, but it\u0027s new right?","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":28,"context_line":".. rest_parameters:: parameters.yaml"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"  - inventories: reshaper_inventories"},{"line_number":31,"context_line":"  - inventories.{uuid}.resource_provider_generation: resource_provider_generation"},{"line_number":32,"context_line":"  - inventories.{uuid}.inventories: inventories"},{"line_number":33,"context_line":"  - allocations: reshaper_allocations"},{"line_number":34,"context_line":"  - allocations.{uuid}.allocations: allocations_dict_empty"}],"source_content_type":"text/x-c++src","patch_set":33,"id":"3f79a3b5_c415e34a","line":31,"range":{"start_line":31,"start_character":16,"end_line":31,"end_character":23},"in_reply_to":"3f79a3b5_21fa8942","updated":"2018-08-22 19:06:52.000000000","message":"I borrowed the nested-ness from the nova-api ref https://developer.openstack.org/api-ref/compute/#list-hypervisors but was unclear how to represent the variability of the uuid. I figured we\u0027d work out in review if we liked it but there hasn\u0027t been much discussion. I think the nestedness is useful given the complexity of the structure but am unsure about the {uuid}, mostly for the reasons you mention next.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":32,"context_line":"  - inventories.{uuid}.inventories: inventories"},{"line_number":33,"context_line":"  - allocations: reshaper_allocations"},{"line_number":34,"context_line":"  - allocations.{uuid}.allocations: allocations_dict_empty"},{"line_number":35,"context_line":"  - allocations.{uuid}.allocations.{uuid}.resources: resources"},{"line_number":36,"context_line":"  - allocations.{uuid}.project_id: project_id_body"},{"line_number":37,"context_line":"  - allocations.{uuid}.user_id: user_id_body"},{"line_number":38,"context_line":"  - allocations.{uuid}.consumer_generation: consumer_generation"}],"source_content_type":"text/x-c++src","patch_set":33,"id":"3f79a3b5_a19bf914","line":35,"range":{"start_line":35,"start_character":3,"end_line":35,"end_character":51},"updated":"2018-08-22 18:10:19.000000000","message":"This is a bit hard in the docs - if {uuid} shows up twice it could be confused as the same value, but really it\u0027s {consumer_uuid} and {provider_uuid} respectively, right?","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cef5bb1d6407565504b6ddb25ad5e62babea3b2c","unresolved":false,"context_lines":[{"line_number":32,"context_line":"  - inventories.{uuid}.inventories: inventories"},{"line_number":33,"context_line":"  - allocations: reshaper_allocations"},{"line_number":34,"context_line":"  - allocations.{uuid}.allocations: allocations_dict_empty"},{"line_number":35,"context_line":"  - allocations.{uuid}.allocations.{uuid}.resources: resources"},{"line_number":36,"context_line":"  - allocations.{uuid}.project_id: project_id_body"},{"line_number":37,"context_line":"  - allocations.{uuid}.user_id: user_id_body"},{"line_number":38,"context_line":"  - allocations.{uuid}.consumer_generation: consumer_generation"}],"source_content_type":"text/x-c++src","patch_set":33,"id":"3f79a3b5_90af2129","line":35,"range":{"start_line":35,"start_character":3,"end_line":35,"end_character":51},"in_reply_to":"3f79a3b5_753cb7c7","updated":"2018-08-22 21:37:53.000000000","message":"I\u0027ll try that, and we\u0027ll see how it renders","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8e153974877d444eabb1dd8b26c01b3a3f34ab7b","unresolved":false,"context_lines":[{"line_number":32,"context_line":"  - inventories.{uuid}.inventories: inventories"},{"line_number":33,"context_line":"  - allocations: reshaper_allocations"},{"line_number":34,"context_line":"  - allocations.{uuid}.allocations: allocations_dict_empty"},{"line_number":35,"context_line":"  - allocations.{uuid}.allocations.{uuid}.resources: resources"},{"line_number":36,"context_line":"  - allocations.{uuid}.project_id: project_id_body"},{"line_number":37,"context_line":"  - allocations.{uuid}.user_id: user_id_body"},{"line_number":38,"context_line":"  - allocations.{uuid}.consumer_generation: consumer_generation"}],"source_content_type":"text/x-c++src","patch_set":33,"id":"3f79a3b5_753cb7c7","line":35,"range":{"start_line":35,"start_character":3,"end_line":35,"end_character":51},"in_reply_to":"3f79a3b5_7f13385d","updated":"2018-08-22 20:18:26.000000000","message":"I would be in favor of changing to {$thing_uuid} (throughout, not just in lines where there\u0027s two) for clarity. I think the syntax is definitely intuitive enough that we don\u0027t need to try to come up with something wildly different.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f3c16d50e12352e4f2d54e9d962edccd3a000ff3","unresolved":false,"context_lines":[{"line_number":32,"context_line":"  - inventories.{uuid}.inventories: inventories"},{"line_number":33,"context_line":"  - allocations: reshaper_allocations"},{"line_number":34,"context_line":"  - allocations.{uuid}.allocations: allocations_dict_empty"},{"line_number":35,"context_line":"  - allocations.{uuid}.allocations.{uuid}.resources: resources"},{"line_number":36,"context_line":"  - allocations.{uuid}.project_id: project_id_body"},{"line_number":37,"context_line":"  - allocations.{uuid}.user_id: user_id_body"},{"line_number":38,"context_line":"  - allocations.{uuid}.consumer_generation: consumer_generation"}],"source_content_type":"text/x-c++src","patch_set":33,"id":"3f79a3b5_1c2fab3f","line":35,"range":{"start_line":35,"start_character":3,"end_line":35,"end_character":51},"in_reply_to":"3f79a3b5_90af2129","updated":"2018-08-23 00:29:11.000000000","message":"Yeah agree with Eric. This is definitely a complicated API so it\u0027s good to be detailed here. Even the sample is not that easy to parse with the eye.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":32,"context_line":"  - inventories.{uuid}.inventories: inventories"},{"line_number":33,"context_line":"  - allocations: reshaper_allocations"},{"line_number":34,"context_line":"  - allocations.{uuid}.allocations: allocations_dict_empty"},{"line_number":35,"context_line":"  - allocations.{uuid}.allocations.{uuid}.resources: resources"},{"line_number":36,"context_line":"  - allocations.{uuid}.project_id: project_id_body"},{"line_number":37,"context_line":"  - allocations.{uuid}.user_id: user_id_body"},{"line_number":38,"context_line":"  - allocations.{uuid}.consumer_generation: consumer_generation"}],"source_content_type":"text/x-c++src","patch_set":33,"id":"3f79a3b5_7f13385d","line":35,"range":{"start_line":35,"start_character":3,"end_line":35,"end_character":51},"in_reply_to":"3f79a3b5_a19bf914","updated":"2018-08-22 19:06:52.000000000","message":"yes, but I couldn\u0027t decide if that mattered here and whether the additional information didn\u0027t just make for noise\n\neasy to change\n\nor do something entirely different","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8f98e7140fd0452833b78b1cfd3a7ac6578733cd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":35,"id":"3f79a3b5_1a954440","line":45,"updated":"2018-08-24 09:53:14.000000000","message":"I think we should state explicitly if there is no body returned in the response, like in case of PUT /traits we state \"No body content is returned on a successful PUT.\"","commit_id":"4d525b4ec1afbcfb93c93a19ccdc452af2ad0ebc"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"76993cb46fd412caeaed1b7355e445bd3e2c85c6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":35,"id":"3f79a3b5_3a53606d","line":45,"in_reply_to":"3f79a3b5_1a954440","updated":"2018-08-24 10:03:16.000000000","message":"That\u0027s fair. If we can do it in a followup near the bottom of the stack that would be nice.\n\nThe response code 204 (No Content) does state it as well though, but I agree it would be more friendly to be explicit.","commit_id":"4d525b4ec1afbcfb93c93a19ccdc452af2ad0ebc"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2cb686a4cd1a5896674daff3717a312ce92e883e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":35,"id":"3f79a3b5_a21ad7c2","line":45,"in_reply_to":"3f79a3b5_3a53606d","updated":"2018-08-24 21:50:10.000000000","message":"https://review.openstack.org/#/c/596494/","commit_id":"4d525b4ec1afbcfb93c93a19ccdc452af2ad0ebc"}],"placement-api-ref/source/samples/reshaper/post-reshaper-1.30.json":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3da6ec0bbf6c05a57f4afc80a6a0cd241ad3e328","unresolved":false,"context_lines":[{"line_number":50,"context_line":"          \"total\": 10"},{"line_number":51,"context_line":"        }"},{"line_number":52,"context_line":"      },"},{"line_number":53,"context_line":"      \"resource_provider_generation\": 0"},{"line_number":54,"context_line":"    },"},{"line_number":55,"context_line":"    \"a7466641-cd72-499b-b6c9-c208eacecb3d\": {"},{"line_number":56,"context_line":"      \"inventories\": {"}],"source_content_type":"application/json","patch_set":27,"id":"3f79a3b5_dd535116","line":53,"range":{"start_line":53,"start_character":38,"end_line":53,"end_character":39},"updated":"2018-08-13 13:46:27.000000000","message":"nit: if we want to signal that this is a new PR then this should be null","commit_id":"9530c9af44406f37599e2b5b76f78bfdb8af116d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a02a227c221c87bc47d2d9c6f3347536872200cc","unresolved":false,"context_lines":[{"line_number":50,"context_line":"          \"total\": 10"},{"line_number":51,"context_line":"        }"},{"line_number":52,"context_line":"      },"},{"line_number":53,"context_line":"      \"resource_provider_generation\": 0"},{"line_number":54,"context_line":"    },"},{"line_number":55,"context_line":"    \"a7466641-cd72-499b-b6c9-c208eacecb3d\": {"},{"line_number":56,"context_line":"      \"inventories\": {"}],"source_content_type":"application/json","patch_set":27,"id":"3f79a3b5_0f00fd66","line":53,"range":{"start_line":53,"start_character":38,"end_line":53,"end_character":39},"in_reply_to":"3f79a3b5_dd535116","updated":"2018-08-21 17:15:20.000000000","message":"Done","commit_id":"9530c9af44406f37599e2b5b76f78bfdb8af116d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5b7c0ac5b70699f89e523c498601d4de9ffcf0e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"  \"allocations\": {"},{"line_number":3,"context_line":"    \"9ae60315-80c2-48a0-a168-ca4f27c307e1\": {"},{"line_number":4,"context_line":"      \"allocations\": {"},{"line_number":5,"context_line":"        \"a7466641-cd72-499b-b6c9-c208eacecb3d\": {"}],"source_content_type":"application/json","patch_set":33,"id":"3f79a3b5_21736918","line":2,"updated":"2018-08-22 18:10:19.000000000","message":"nit: might be nice to have an example of clearing allocations for a given consumer, like in the POST /allocations sample.\n\nhttps://developer.openstack.org/api-ref/placement/#manage-allocations","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"772e5700228476faa50eedc32c70c3403f3441f2","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"  \"allocations\": {"},{"line_number":3,"context_line":"    \"9ae60315-80c2-48a0-a168-ca4f27c307e1\": {"},{"line_number":4,"context_line":"      \"allocations\": {"},{"line_number":5,"context_line":"        \"a7466641-cd72-499b-b6c9-c208eacecb3d\": {"}],"source_content_type":"application/json","patch_set":33,"id":"3f79a3b5_a49b0715","line":2,"in_reply_to":"3f79a3b5_21736918","updated":"2018-08-22 19:06:52.000000000","message":"If I remember right (it\u0027s been a while) I made this from the output of one of the gabbi tests, and included it only because we are obliged to fill these things out for the docs. Given the current scope of who and what will be using /reshaper trying to model a fully real and complete example seemed less important here than on something like manage-allocations","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f3c16d50e12352e4f2d54e9d962edccd3a000ff3","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"  \"allocations\": {"},{"line_number":3,"context_line":"    \"9ae60315-80c2-48a0-a168-ca4f27c307e1\": {"},{"line_number":4,"context_line":"      \"allocations\": {"},{"line_number":5,"context_line":"        \"a7466641-cd72-499b-b6c9-c208eacecb3d\": {"}],"source_content_type":"application/json","patch_set":33,"id":"3f79a3b5_fc298f36","line":2,"in_reply_to":"3f79a3b5_a49b0715","updated":"2018-08-23 00:29:11.000000000","message":"Sure, hence a nit and \u0027might be nice\u0027.","commit_id":"1f86185dd4e2ad95ec0481d403a0115be94e598c"}],"releasenotes/notes/placement-reshaper-6f3ef70c3a550d09.yaml":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"33822f3ff0959d70d0262372dbf69e53946c8f77","unresolved":false,"context_lines":[{"line_number":8,"context_line":"    inventory moves from a parent provider to a new child provider."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"    .. note:: This is a special operation that should only be used in rare"},{"line_number":11,"context_line":"              cases where the resource provider topology of a single physical"},{"line_number":12,"context_line":"              resource has changed. It has the potential to be slow and to lock"},{"line_number":13,"context_line":"              several database tables."}],"source_content_type":"text/x-yaml","patch_set":11,"id":"5f7c97a3_be3d0f8e","line":11,"range":{"start_line":11,"start_character":62,"end_line":11,"end_character":77},"updated":"2018-07-19 15:11:23.000000000","message":"ditto","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e119e1bff2fc3839ace30407ac464836ca322c00","unresolved":false,"context_lines":[{"line_number":8,"context_line":"    inventory moves from a parent provider to a new child provider."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"    .. note:: This is a special operation that should only be used in rare"},{"line_number":11,"context_line":"              cases where the resource provider topology of a single physical"},{"line_number":12,"context_line":"              resource has changed. It has the potential to be slow and to lock"},{"line_number":13,"context_line":"              several database tables."}],"source_content_type":"text/x-yaml","patch_set":11,"id":"5f7c97a3_fdda9673","line":11,"range":{"start_line":11,"start_character":62,"end_line":11,"end_character":77},"in_reply_to":"5f7c97a3_be3d0f8e","updated":"2018-07-20 10:46:01.000000000","message":"Done","commit_id":"18e8f4d94c650c8b8b0e762318e5c0e7a7209454"}]}
