)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"0303dc42f9d99d9a79690f7de3a9d5481302dece","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Matt Riedemann \u003cmriedem.os@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2019-10-28 16:55:38 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add --no-provider option to resource provider allocation set"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"A new ``--no-provider`` option is added to the"},{"line_number":10,"context_line":"``openstack resource provider allocation set`` command which is mutually"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3fa7e38b_13b35aeb","line":7,"range":{"start_line":7,"start_character":4,"end_line":7,"end_character":17},"updated":"2019-11-13 20:39:46.000000000","message":"It might just be me, but I don\u0027t really understand how the naming \"no provider\" indicates removal of allocations for a RP. I\u0027m not suggesting changing it, just that it confused me and it wasn\u0027t until I read the config option help that I understood what it means and how to use it.\n\nAnd the only other name I could think of might be --remove-for-provider","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"586696d0739f582e6b263a5f3908ab707f230eab","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Matt Riedemann \u003cmriedem.os@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2019-10-28 16:55:38 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add --no-provider option to resource provider allocation set"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"A new ``--no-provider`` option is added to the"},{"line_number":10,"context_line":"``openstack resource provider allocation set`` command which is mutually"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3fa7e38b_73464ec3","line":7,"range":{"start_line":7,"start_character":4,"end_line":7,"end_character":17},"in_reply_to":"3fa7e38b_13b35aeb","updated":"2019-11-13 20:55:55.000000000","message":"Yeah it\u0027s an OSC convention. I don\u0027t love it either.\n\nReading back on my notes in https://storyboard.openstack.org/#!/story/2006779 I originally wanted to do something with \"openstack resource provider allocation delete \u003cconsumer_uuid\u003e --provider \u003cprovider to remove allocations rather than all\u003e\" but that got hairy for different reasons so I just went with --no-provider on the allocation set command, which is similar to port set, e.g. --no-tag, --no-binding-profile, etc:\n\nhttps://docs.openstack.org/python-openstackclient/latest/cli/command-objects/port.html#port-set","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"f13a92f0c5c37f26d34a58c11e6081a591c91429","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"A new ``--no-provider`` option is added to the"},{"line_number":10,"context_line":"``openstack resource provider allocation set`` command which is mutually"},{"line_number":11,"context_line":"excluse with the ``--allocation`` option and will allow removing a specific"},{"line_number":12,"context_line":"resource provider from the set of allocations for the given consumer."},{"line_number":13,"context_line":"This can be useful when a consumer has allocations against more than one"},{"line_number":14,"context_line":"resource provider and ``openstack resource provider allocation delete``"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3fa7e38b_7bcd3c2e","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":7},"updated":"2019-11-04 01:08:46.000000000","message":"exclusive","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"}],"osc_placement/resources/allocation.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7498b6290bf9bf4f9b937c62e4504c16c8356cc6","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            # against the provider in case we lost a race since the allocations"},{"line_number":131,"context_line":"            # are in the state the user wants them in anyway."},{"line_number":132,"context_line":"            if self.compare_version(version.ge(\u00271.12\u0027)):"},{"line_number":133,"context_line":"                if parsed_args.no_provider in allocations:"},{"line_number":134,"context_line":"                    del allocations[parsed_args.no_provider]"},{"line_number":135,"context_line":"                    # Remove the resource provider \u0027generation\u0027 key per"},{"line_number":136,"context_line":"                    # provider that is still in the allocations since that is"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_d2001f37","line":133,"updated":"2019-10-28 20:55:34.000000000","message":"If this is false,","commit_id":"50af508ce75790a55c7570b51bf3bf1763491bfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7498b6290bf9bf4f9b937c62e4504c16c8356cc6","unresolved":false,"context_lines":[{"line_number":136,"context_line":"                    # provider that is still in the allocations since that is"},{"line_number":137,"context_line":"                    # not part of the PUT request schema."},{"line_number":138,"context_line":"                    for allocation in allocations.values():"},{"line_number":139,"context_line":"                        del allocation[\u0027generation\u0027]"},{"line_number":140,"context_line":"            else:"},{"line_number":141,"context_line":"                # Pre-1.12 GET and PUT formats are different so build the PUT"},{"line_number":142,"context_line":"                # payload from scratch based on the GET results."}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_72f92b4c","line":139,"updated":"2019-10-28 20:55:34.000000000","message":"we won\u0027t remove this which would result in a PUT schema 400 error.","commit_id":"50af508ce75790a55c7570b51bf3bf1763491bfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e7dfd7eb8e2d8417e01a2ffef051736133d47289","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            help\u003d\u0027Create (or update) an allocation of a resource class. \u0027"},{"line_number":84,"context_line":"                 \u0027Specify option multiple times to set multiple allocations.\u0027"},{"line_number":85,"context_line":"        )"},{"line_number":86,"context_line":"        allocation_group.add_argument("},{"line_number":87,"context_line":"            \u0027--no-provider\u0027,"},{"line_number":88,"context_line":"            metavar\u003d\u0027provider_uuid\u0027,"},{"line_number":89,"context_line":"            help\u003d\u0027UUID of a specific resource provider from which to remove \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_d814c143","line":86,"updated":"2019-10-28 21:12:43.000000000","message":"Should this include action\u003d\u0027append\u0027 so you can specify more than one provider to remove?","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"0303dc42f9d99d9a79690f7de3a9d5481302dece","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            help\u003d\u0027Create (or update) an allocation of a resource class. \u0027"},{"line_number":84,"context_line":"                 \u0027Specify option multiple times to set multiple allocations.\u0027"},{"line_number":85,"context_line":"        )"},{"line_number":86,"context_line":"        allocation_group.add_argument("},{"line_number":87,"context_line":"            \u0027--no-provider\u0027,"},{"line_number":88,"context_line":"            metavar\u003d\u0027provider_uuid\u0027,"},{"line_number":89,"context_line":"            help\u003d\u0027UUID of a specific resource provider from which to remove \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_5390f242","line":86,"in_reply_to":"3fa7e38b_1bdc48df","updated":"2019-11-13 20:39:46.000000000","message":"I have a use case :)\n\nWe have a case in our CI cloud downstream (openstack) where some messed up migrations resulted in allocations on three different resource providers. And we\u0027re looking to delete the allocations from two of the three providers. So, being able to specify the two RPs would let us do it with one command run instead of two.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"586696d0739f582e6b263a5f3908ab707f230eab","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            help\u003d\u0027Create (or update) an allocation of a resource class. \u0027"},{"line_number":84,"context_line":"                 \u0027Specify option multiple times to set multiple allocations.\u0027"},{"line_number":85,"context_line":"        )"},{"line_number":86,"context_line":"        allocation_group.add_argument("},{"line_number":87,"context_line":"            \u0027--no-provider\u0027,"},{"line_number":88,"context_line":"            metavar\u003d\u0027provider_uuid\u0027,"},{"line_number":89,"context_line":"            help\u003d\u0027UUID of a specific resource provider from which to remove \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_b325a60c","line":86,"in_reply_to":"3fa7e38b_5390f242","updated":"2019-11-13 20:55:55.000000000","message":"\u003e I have a use case :)\n \u003e \n \u003e We have a case in our CI cloud downstream (openstack) where some\n \u003e messed up migrations resulted in allocations on three different\n \u003e resource providers. And we\u0027re looking to delete the allocations\n \u003e from two of the three providers. So, being able to specify the two\n \u003e RPs would let us do it with one command run instead of two.\n\nAck, yeah, I think eandersson (blizzard) has reported something similar when they were upgrading to rocky and had a bunch of orphaned migration-based allocations from moving servers around and something failing and not cleaning up properly on each migration attempt. I think I told him to just delete them all and run heal_allocations since that would be easier.\n\nI\u0027ll add append for this and write a test for it.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"f13a92f0c5c37f26d34a58c11e6081a591c91429","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            help\u003d\u0027Create (or update) an allocation of a resource class. \u0027"},{"line_number":84,"context_line":"                 \u0027Specify option multiple times to set multiple allocations.\u0027"},{"line_number":85,"context_line":"        )"},{"line_number":86,"context_line":"        allocation_group.add_argument("},{"line_number":87,"context_line":"            \u0027--no-provider\u0027,"},{"line_number":88,"context_line":"            metavar\u003d\u0027provider_uuid\u0027,"},{"line_number":89,"context_line":"            help\u003d\u0027UUID of a specific resource provider from which to remove \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_1bdc48df","line":86,"in_reply_to":"3fa7e38b_d814c143","updated":"2019-11-04 01:08:46.000000000","message":"Honestly speaking I don’t come up a use case for that now, but I say yes because it is easier to change it now than to add the feature in the future with our compatibility culture.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"f13a92f0c5c37f26d34a58c11e6081a591c91429","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                 \u0027and you want to cleanup allocations on the source compute \u0027"},{"line_number":94,"context_line":"                 \u0027node resource provider in order to delete it. It is \u0027"},{"line_number":95,"context_line":"                 \u0027strongly recommended to use \u0027"},{"line_number":96,"context_line":"                 \u0027``--os-placement-api-version 1.28`` when using this option \u0027"},{"line_number":97,"context_line":"                 \u0027to ensure the consumer project, user and other allocation \u0027"},{"line_number":98,"context_line":"                 \u0027information is retained.\u0027"},{"line_number":99,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_3bdb44ed","line":96,"range":{"start_line":96,"start_character":20,"end_line":96,"end_character":51},"updated":"2019-11-04 01:08:46.000000000","message":"FWIW, the current supported version is 1.22. Though I don’t think we should -W this before 1.28, I prefer to catch up with it before the release. Let’s just work on.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"586696d0739f582e6b263a5f3908ab707f230eab","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                 \u0027and you want to cleanup allocations on the source compute \u0027"},{"line_number":94,"context_line":"                 \u0027node resource provider in order to delete it. It is \u0027"},{"line_number":95,"context_line":"                 \u0027strongly recommended to use \u0027"},{"line_number":96,"context_line":"                 \u0027``--os-placement-api-version 1.28`` when using this option \u0027"},{"line_number":97,"context_line":"                 \u0027to ensure the consumer project, user and other allocation \u0027"},{"line_number":98,"context_line":"                 \u0027information is retained.\u0027"},{"line_number":99,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_3377760b","line":96,"range":{"start_line":96,"start_character":20,"end_line":96,"end_character":51},"in_reply_to":"3fa7e38b_3bdb44ed","updated":"2019-11-13 20:55:55.000000000","message":"We don\u0027t really have to follow the supported API microversions in order like python-novaclient does. That\u0027s more of a process thing and how nova CLI works (the CLI defaults to the latest negotiated microversion that the server and client understands), but OSC doesn\u0027t work that way so as long as you can specify a version and it works we\u0027re OK.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"f13a92f0c5c37f26d34a58c11e6081a591c91429","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # Determine if we\u0027re removing a single provider from existing"},{"line_number":123,"context_line":"        # allocations or doing a full replacement."},{"line_number":124,"context_line":"        if parsed_args.no_provider:"},{"line_number":125,"context_line":"            # Get the current allocations."},{"line_number":126,"context_line":"            payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":127,"context_line":"            old_allocations \u003d payload[\u0027allocations\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_5bd640c5","line":124,"range":{"start_line":124,"start_character":11,"end_line":124,"end_character":34},"updated":"2019-11-04 01:08:46.000000000","message":"Good to add malformed uuid check and accept CAPITAL uuids also, that said this isn’t sent, checked or normalized in the server side.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"6051f933bdbea25f6c810399cb810752d7082dd8","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # Determine if we\u0027re removing a single provider from existing"},{"line_number":123,"context_line":"        # allocations or doing a full replacement."},{"line_number":124,"context_line":"        if parsed_args.no_provider:"},{"line_number":125,"context_line":"            # Get the current allocations."},{"line_number":126,"context_line":"            payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":127,"context_line":"            old_allocations \u003d payload[\u0027allocations\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_8d48822e","line":124,"range":{"start_line":124,"start_character":11,"end_line":124,"end_character":34},"in_reply_to":"3fa7e38b_1384bad2","updated":"2019-11-14 10:11:51.000000000","message":"\u003e If you specify a provider that\n \u003e doesn\u0027t exist on the CLI you\u0027ll likely get a 400 or 404 from the\n \u003e server which is correct behavior.\n\nNote that this is not 400 or 404. Having wrong uuid on this value will be a silent error since it is not passed to the server. This is why I don\u0027t think validation is that too much here.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"7b0bf08b7b5c5a48e46b6ca7fa6cdbdabde05bca","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # Determine if we\u0027re removing a single provider from existing"},{"line_number":123,"context_line":"        # allocations or doing a full replacement."},{"line_number":124,"context_line":"        if parsed_args.no_provider:"},{"line_number":125,"context_line":"            # Get the current allocations."},{"line_number":126,"context_line":"            payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":127,"context_line":"            old_allocations \u003d payload[\u0027allocations\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_454a6483","line":124,"range":{"start_line":124,"start_character":11,"end_line":124,"end_character":34},"in_reply_to":"3fa7e38b_1384bad2","updated":"2019-11-14 10:02:27.000000000","message":"I wondered if users get confused when they create resource providers with something like:\n\n    openstack resource provider create rp1 --uuid 377EB9E7-AFFF-42C3-B687-DE67C98E776C\n\nand/or set inventory and/or create allocation with that kind of capital uuid, find it works properly, and then find that something like:\n\n    openstack resource provider allocation set --no-provider 377EB9E7-AFFF-42C3-B687-DE67C98E776C\n\ndoesn\u0027t work as expected, since \"\u003ccapital_uuid\u003e !\u003d\u003cactual_uuid\u003e\" ...\n\nAgree that this is a corner case and validation may be too much, but it may help someone to have just a bit normalization of lower()\u0027ing the value.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f1130c15512c2a5b5580183f3b18321134e913d4","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # Determine if we\u0027re removing a single provider from existing"},{"line_number":123,"context_line":"        # allocations or doing a full replacement."},{"line_number":124,"context_line":"        if parsed_args.no_provider:"},{"line_number":125,"context_line":"            # Get the current allocations."},{"line_number":126,"context_line":"            payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":127,"context_line":"            old_allocations \u003d payload[\u0027allocations\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_5148d8b1","line":124,"range":{"start_line":124,"start_character":11,"end_line":124,"end_character":34},"in_reply_to":"3fa7e38b_454a6483","updated":"2019-11-14 20:48:24.000000000","message":"\u003e I wondered if users get confused when they create resource\n \u003e providers with something like:\n \u003e \n \u003e openstack resource provider create rp1 --uuid 377EB9E7-AFFF-42C3-B687-DE67C98E776C\n \u003e \n \u003e and/or set inventory and/or create allocation with that kind of\n \u003e capital uuid, find it works properly, and then find that something\n \u003e like:\n \u003e \n \u003e openstack resource provider allocation set --no-provider\n \u003e 377EB9E7-AFFF-42C3-B687-DE67C98E776C\n \u003e \n \u003e doesn\u0027t work as expected, since \"\u003ccapital_uuid\u003e !\u003d\u003cactual_uuid\u003e\"\n \u003e ...\n\nI must be blind because I don\u0027t see where those UUIDs are not the same. Do you mean when setting the allocations or removing the provider, it would fail because the database stores the uuid values as lower-case? If so, that\u0027s database backend specific behavior (I believe MySQL has that problem but postgresql does not). I seem to remember a bug in nova related to that same kind of issue.\n\n \u003e \n \u003e Agree that this is a corner case and validation may be too much,\n \u003e but it may help someone to have just a bit normalization of\n \u003e lower()\u0027ing the value.\n\nI don\u0027t think it\u0027s appropriate to try and do that from the client when it\u0027s db-backend specific in the server as noted above.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"dd1d2d22e31c0163ffed9c243eb77bc4905cab68","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # Determine if we\u0027re removing a single provider from existing"},{"line_number":123,"context_line":"        # allocations or doing a full replacement."},{"line_number":124,"context_line":"        if parsed_args.no_provider:"},{"line_number":125,"context_line":"            # Get the current allocations."},{"line_number":126,"context_line":"            payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":127,"context_line":"            old_allocations \u003d payload[\u0027allocations\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_ed9e8fb6","line":124,"range":{"start_line":124,"start_character":11,"end_line":124,"end_character":34},"in_reply_to":"3fa7e38b_5148d8b1","updated":"2019-11-20 13:10:44.000000000","message":"\u003e \u003e openstack resource provider allocation set --no-provider\n \u003e \u003e 377EB9E7-AFFF-42C3-B687-DE67C98E776C\n \u003e \u003e\n \u003e \u003e doesn\u0027t work as expected, since \"\u003ccapital_uuid\u003e !\u003d\u003cactual_uuid\u003e\"\n \u003e \n \u003e I must be blind because I don\u0027t see where those UUIDs are not the\n \u003e same. \n\nIt is in L136, PS3 and in L210, PS7.\n\n \u003e \u003e\n \u003e \u003e Agree that this is a corner case and validation may be too much,\n \u003e \u003e but it may help someone to have just a bit normalization of\n \u003e \u003e lower()\u0027ing the value.\n \u003e \n \u003e I don\u0027t think it\u0027s appropriate to try and do that from the client\n \u003e when it\u0027s db-backend specific in the server as noted above.\n\nAs said above this is not DB matter. We can do that validation/normalization only in client since it is not sent to the server. Its scope is client only.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"586696d0739f582e6b263a5f3908ab707f230eab","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # Determine if we\u0027re removing a single provider from existing"},{"line_number":123,"context_line":"        # allocations or doing a full replacement."},{"line_number":124,"context_line":"        if parsed_args.no_provider:"},{"line_number":125,"context_line":"            # Get the current allocations."},{"line_number":126,"context_line":"            payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":127,"context_line":"            old_allocations \u003d payload[\u0027allocations\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_1384bad2","line":124,"range":{"start_line":124,"start_character":11,"end_line":124,"end_character":34},"in_reply_to":"3fa7e38b_5bd640c5","updated":"2019-11-13 20:55:55.000000000","message":"We don\u0027t do any kind of uuid validation for providers or consumers in osc-placement today do we? If you specify a provider that doesn\u0027t exist on the CLI you\u0027ll likely get a 400 or 404 from the server which is correct behavior.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"f13a92f0c5c37f26d34a58c11e6081a591c91429","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                allocations \u003d {"},{"line_number":134,"context_line":"                    rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"},{"line_number":135,"context_line":"                    for rp_uuid, alloc in old_allocations.items()"},{"line_number":136,"context_line":"                    if rp_uuid !\u003d parsed_args.no_provider}"},{"line_number":137,"context_line":"            else:"},{"line_number":138,"context_line":"                allocations \u003d [{"},{"line_number":139,"context_line":"                    \u0027resource_provider\u0027: {\u0027uuid\u0027: rp_uuid},"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_fbe04c99","line":136,"range":{"start_line":136,"start_character":20,"end_line":136,"end_character":57},"updated":"2019-11-04 01:08:46.000000000","message":"If this results in empty allocation (i.e. previous one was on only one given rp) it looks like that http 400 is returned. Should we call the DELETE method instead for that specific case?","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02af08a566b2218eba215d6b220343f13e931155","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                allocations \u003d {"},{"line_number":134,"context_line":"                    rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"},{"line_number":135,"context_line":"                    for rp_uuid, alloc in old_allocations.items()"},{"line_number":136,"context_line":"                    if rp_uuid !\u003d parsed_args.no_provider}"},{"line_number":137,"context_line":"            else:"},{"line_number":138,"context_line":"                allocations \u003d [{"},{"line_number":139,"context_line":"                    \u0027resource_provider\u0027: {\u0027uuid\u0027: rp_uuid},"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_fce67b4a","line":136,"range":{"start_line":136,"start_character":20,"end_line":136,"end_character":57},"in_reply_to":"3fa7e38b_13eb5a78","updated":"2019-11-14 21:56:45.000000000","message":"Confirmed that we can\u0027t PUT /allocations/{consumer_id} with an empty allocations dict:\n\n    b\u0027   DEBUG [placement.wsgi_wrapper] Placement API returning an error response: JSON does not validate: {} does not have enough properties\u0027\n    b\u0027\u0027\n    b\"Failed validating \u0027minProperties\u0027 in schema[\u0027properties\u0027][\u0027allocations\u0027]:\"\n    b\"    {\u0027additionalProperties\u0027: False,\"\n    b\"     \u0027minProperties\u0027: 1,\"\n    b\"     \u0027patternProperties\u0027: {\u0027^[0-9a-fA-F-]{36}$\u0027: {\u0027additionalProperties\u0027: False,\"\n    b\"                                                  \u0027properties\u0027: {\u0027generation\u0027: {\u0027type\u0027: \u0027integer\u0027},\"\n    b\"                                                                 \u0027resources\u0027: {\u0027additionalProperties\u0027: False,\"\n    b\"                                                                               \u0027minProperties\u0027: 1,\"\n    b\"                                                                               \u0027patternProperties\u0027: {\u0027^[A-Z0-9_]+$\u0027: {\u0027minimum\u0027: 1,\"\n    b\"                                                                                                                      \u0027type\u0027: \u0027integer\u0027}},\"\n    b\"                                                                               \u0027type\u0027: \u0027object\u0027}},\"\n    b\"                                                  \u0027required\u0027: [\u0027resources\u0027],\"\n    b\"                                                  \u0027type\u0027: \u0027object\u0027}},\"\n    b\"     \u0027type\u0027: \u0027object\u0027}\"\n    b\u0027\u0027\n    b\"On instance[\u0027allocations\u0027]:\"\n    b\u0027    {}\u0027\n    b\u0027    INFO [placement.requestlog] 127.0.0.1 \"PUT /placement/allocations/6942c84a-d05f-464b-b957-8f97385fe4cf\" status: 400 len: 1389 microversion: 1.12\u0027\n\nChanging to DELETE below if all providers are removed is trivial so I\u0027ll do that. It looks like we just don\u0027t print anything out, similar to \u0027openstack resource provider allocation delete\u0027.","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"586696d0739f582e6b263a5f3908ab707f230eab","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                allocations \u003d {"},{"line_number":134,"context_line":"                    rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"},{"line_number":135,"context_line":"                    for rp_uuid, alloc in old_allocations.items()"},{"line_number":136,"context_line":"                    if rp_uuid !\u003d parsed_args.no_provider}"},{"line_number":137,"context_line":"            else:"},{"line_number":138,"context_line":"                allocations \u003d [{"},{"line_number":139,"context_line":"                    \u0027resource_provider\u0027: {\u0027uuid\u0027: rp_uuid},"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_13eb5a78","line":136,"range":{"start_line":136,"start_character":20,"end_line":136,"end_character":57},"in_reply_to":"3fa7e38b_fbe04c99","updated":"2019-11-13 20:55:55.000000000","message":"I\u0027ll add a test for that because I want to say I thought at one point nova was using that behavior to clear allocations (PUT /allocations/{consumer_id} with an empty \"allocations\" dict) but I might be thinking of POST /allocations which nova uses to move allocations from one consumer to another.\n\nOne tricky thing about changing to use DELETE would be the code below does a GET after the PUT so the resulting allocations are printed out, but if we DELETE then there is nothing to show. Maybe that will work OK though and an empty table will be printed out.\n\nI know that \"openstack resource provider allocation delete\" doesn\u0027t print anything out (it doesn\u0027t implement the command.Lister mixin).","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c487729f77ad2b23f1090809ce5c690d695f07c7","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                 \u0027consumer has allocations on more than one provider, for \u0027"},{"line_number":94,"context_line":"                 \u0027example after evacuating a server to another compute node \u0027"},{"line_number":95,"context_line":"                 \u0027and you want to cleanup allocations on the source compute \u0027"},{"line_number":96,"context_line":"                 \u0027node resource provider in order to delete it. It is \u0027"},{"line_number":97,"context_line":"                 \u0027strongly recommended to use \u0027"},{"line_number":98,"context_line":"                 \u0027``--os-placement-api-version 1.28`` or greater when using \u0027"},{"line_number":99,"context_line":"                 \u0027this option to ensure the consumer project, user and other \u0027"},{"line_number":100,"context_line":"                 \u0027allocation information is retained. \u0027"},{"line_number":101,"context_line":"                 \u0027Specify multiple times to remove allocations against \u0027"},{"line_number":102,"context_line":"                 \u0027multiple resource providers.\u0027"},{"line_number":103,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_37750c33","line":100,"range":{"start_line":96,"start_character":63,"end_line":100,"end_character":55},"updated":"2019-11-14 23:19:41.000000000","message":"except we\u0027re not retaining/using the consumer generation, so (esp with the DELETE call) we can still lose races with other operations in ways that are bad.\n\nAlso, I don\u0027t think we\u0027re testing with 1.28, because if we were, shouldn\u0027t we fail due to missing consumer generation in the payload?\n\nMaybe we\u0027re mocked out higher than that. But I suspect that ^ would be the case if you ran this live.","commit_id":"9b2f9891dbee65dcd7e1c9205b762cc316c5abc5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7387dd9ded6ba0da0d7bc2bca0d14c0465c9cc34","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                 \u0027consumer has allocations on more than one provider, for \u0027"},{"line_number":94,"context_line":"                 \u0027example after evacuating a server to another compute node \u0027"},{"line_number":95,"context_line":"                 \u0027and you want to cleanup allocations on the source compute \u0027"},{"line_number":96,"context_line":"                 \u0027node resource provider in order to delete it. It is \u0027"},{"line_number":97,"context_line":"                 \u0027strongly recommended to use \u0027"},{"line_number":98,"context_line":"                 \u0027``--os-placement-api-version 1.28`` or greater when using \u0027"},{"line_number":99,"context_line":"                 \u0027this option to ensure the consumer project, user and other \u0027"},{"line_number":100,"context_line":"                 \u0027allocation information is retained. \u0027"},{"line_number":101,"context_line":"                 \u0027Specify multiple times to remove allocations against \u0027"},{"line_number":102,"context_line":"                 \u0027multiple resource providers.\u0027"},{"line_number":103,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_4e226ebc","line":100,"range":{"start_line":96,"start_character":63,"end_line":100,"end_character":55},"in_reply_to":"3fa7e38b_37750c33","updated":"2019-11-15 14:12:43.000000000","message":"\u003e except we\u0027re not retaining/using the consumer generation, so (esp\n\nI\u0027m not sure what you mean. The code does a GET /allocations/{consumer_id}, modifies the \u0027allocations\u0027 dict part of that response, and then PUTs it back (assuming there are still some allocations). If using 1.28 the consumer_generation field will be in the GET response and be PUT back after updating the \u0027allocations\u0027 dict.\n\n \u003e with the DELETE call) we can still lose races with other operations\n \u003e in ways that are bad.\n \u003e \n \u003e Also, I don\u0027t think we\u0027re testing with 1.28, because if we were,\n \u003e shouldn\u0027t we fail due to missing consumer generation in the\n \u003e payload?\n\nI\u0027ll add a test for 1.28 but as noted above I think we\u0027re OK since GET and PUT are mirrored.\n\n \u003e \n \u003e Maybe we\u0027re mocked out higher than that. But I suspect that ^ would\n \u003e be the case if you ran this live.","commit_id":"9b2f9891dbee65dcd7e1c9205b762cc316c5abc5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a87d69793ee4f60d3e28bc2805603a4fb46e8538","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                 \u0027consumer has allocations on more than one provider, for \u0027"},{"line_number":94,"context_line":"                 \u0027example after evacuating a server to another compute node \u0027"},{"line_number":95,"context_line":"                 \u0027and you want to cleanup allocations on the source compute \u0027"},{"line_number":96,"context_line":"                 \u0027node resource provider in order to delete it. It is \u0027"},{"line_number":97,"context_line":"                 \u0027strongly recommended to use \u0027"},{"line_number":98,"context_line":"                 \u0027``--os-placement-api-version 1.28`` or greater when using \u0027"},{"line_number":99,"context_line":"                 \u0027this option to ensure the consumer project, user and other \u0027"},{"line_number":100,"context_line":"                 \u0027allocation information is retained. \u0027"},{"line_number":101,"context_line":"                 \u0027Specify multiple times to remove allocations against \u0027"},{"line_number":102,"context_line":"                 \u0027multiple resource providers.\u0027"},{"line_number":103,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_b427b063","line":100,"range":{"start_line":96,"start_character":63,"end_line":100,"end_character":55},"in_reply_to":"3fa7e38b_4e226ebc","updated":"2019-11-15 14:32:33.000000000","message":"\u003e I\u0027ll add a test for 1.28 but as noted above I think we\u0027re OK since\n \u003e GET and PUT are mirrored.\n \u003e \n\nWell I\u0027ll be damned:\n\n    b\u0027   DEBUG [placement.requestlog] Starting request: 127.0.0.1 \"PUT /placement/allocations/154e2be5-583f-412f-a897-20e642b1db89\"\u0027\n    b\"   DEBUG [placement.wsgi_wrapper] Placement API returning an error response: JSON does not validate: \u0027consumer_generation\u0027 is a required property\"\n    b\u0027\u0027\n    b\"Failed validating \u0027required\u0027 in schema:\"\n    b\"    {\u0027additionalProperties\u0027: False,\"\n    b\"     \u0027properties\u0027: {\u0027allocations\u0027: {\u0027additionalProperties\u0027: False,\"\n    b\"                                    \u0027minProperties\u0027: 0,\"\n    b\"                                    \u0027patternProperties\u0027: {\u0027^[0-9a-fA-F-]{36}$\u0027: {\u0027additionalProperties\u0027: False,\"\n    b\"                                                                                 \u0027properties\u0027: {\u0027generation\u0027: {\u0027type\u0027: \u0027integer\u0027},\"\n    b\"                                                                                                \u0027resources\u0027: {\u0027additionalProperties\u0027: False,\"\n    b\"                                                                                                              \u0027minProperties\u0027: 1,\"\n    b\"                                                                                                              \u0027patternProperties\u0027: {\u0027^[A-Z0-9_]+$\u0027: {\u0027minimum\u0027: 1,\"\n    b\"                                                                                                                                                     \u0027type\u0027: \u0027integer\u0027}},\"\n    b\"                                                                                                              \u0027type\u0027: \u0027object\u0027}},\"\n    b\"                                                                                 \u0027required\u0027: [\u0027resources\u0027],\"\n    b\"                                                                                 \u0027type\u0027: \u0027object\u0027}},\"\n    b\"                                    \u0027type\u0027: \u0027object\u0027},\"\n    b\"                    \u0027consumer_generation\u0027: {\u0027additionalProperties\u0027: False,\"\n    b\"                                            \u0027type\u0027: [\u0027integer\u0027, \u0027null\u0027]},\"\n    b\"                    \u0027project_id\u0027: {\u0027maxLength\u0027: 255,\"\n    b\"                                   \u0027minLength\u0027: 1,\"\n    b\"                                   \u0027type\u0027: \u0027string\u0027},\"\n    b\"                    \u0027user_id\u0027: {\u0027maxLength\u0027: 255,\"\n    b\"                                \u0027minLength\u0027: 1,\"\n    b\"                                \u0027type\u0027: \u0027string\u0027}},\"\n    b\"     \u0027required\u0027: [\u0027allocations\u0027,\"\n    b\"                  \u0027project_id\u0027,\"\n    b\"                  \u0027user_id\u0027,\"\n    b\"                  \u0027consumer_generation\u0027],\"\n    b\"     \u0027type\u0027: \u0027object\u0027}\"\n    b\u0027\u0027\n    b\u0027On instance:\u0027\n    b\"    {\u0027allocations\u0027: {\u00279a02398d-c3a8-4eec-9f4c-6ea858703a29\u0027: {\u0027resources\u0027: {\u0027MEMORY_MB\u0027: 512,\"\n    b\"                                                                            \u0027VCPU\u0027: 2}},\"\n    b\"                     \u0027b357f26e-44c5-4f91-9f31-245c158cea57\u0027: {\u0027resources\u0027: {\u0027VGPU\u0027: 1}}},\"\n    b\"     \u0027project_id\u0027: \u00272f50b2ef-cac5-4c85-805c-4dfc456f00de\u0027,\"\n    b\"     \u0027user_id\u0027: \u002700f39a00-72d1-4a8f-a636-9c46669793b1\u0027}\"\n    b\u0027    INFO [placement.requestlog] 127.0.0.1 \"PUT /placement/allocations/154e2be5-583f-412f-a897-20e642b1db89\" status: 400 len: 2792 microversion: 1.28\u0027","commit_id":"9b2f9891dbee65dcd7e1c9205b762cc316c5abc5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"29616eaa11436e0e35a8a7e87698f9200545d753","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                    for rp, resources in allocations.items()]"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        if allocations:"},{"line_number":163,"context_line":"            payload \u003d {\u0027allocations\u0027: allocations}"},{"line_number":164,"context_line":"            if self.compare_version(version.ge(\u00271.8\u0027)):"},{"line_number":165,"context_line":"                payload[\u0027project_id\u0027] \u003d parsed_args.project_id"},{"line_number":166,"context_line":"                payload[\u0027user_id\u0027] \u003d parsed_args.user_id"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_d4ba6cdf","line":163,"updated":"2019-11-15 14:35:43.000000000","message":"Yeah so here we lose the GET payload since we\u0027re overwriting it, but if using 1.28+ we need to stuff the consumer_generation in there, but we only do a GET in the --no-provider case early.\n\nSo two options that I see:\n\n1. Ditch the 1.28 wording in the help.\n2. Add support for 1.28 before this change and then build on it.","commit_id":"9b2f9891dbee65dcd7e1c9205b762cc316c5abc5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fd5170bb9d4cc41acf662230bb6a96fca708853f","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                    for rp, resources in allocations.items()]"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        if allocations:"},{"line_number":163,"context_line":"            payload \u003d {\u0027allocations\u0027: allocations}"},{"line_number":164,"context_line":"            if self.compare_version(version.ge(\u00271.8\u0027)):"},{"line_number":165,"context_line":"                payload[\u0027project_id\u0027] \u003d parsed_args.project_id"},{"line_number":166,"context_line":"                payload[\u0027user_id\u0027] \u003d parsed_args.user_id"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_14a6c455","line":163,"in_reply_to":"3fa7e38b_d4ba6cdf","updated":"2019-11-15 14:57:40.000000000","message":"Actually it was pretty easy to support 1.28:\n\nhttp://paste.openstack.org/show/786187/","commit_id":"9b2f9891dbee65dcd7e1c9205b762cc316c5abc5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c487729f77ad2b23f1090809ce5c690d695f07c7","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        else:"},{"line_number":173,"context_line":"            # The user must have removed all of the allocations using the"},{"line_number":174,"context_line":"            # --no-provider option so just DELETE the allocations since we"},{"line_number":175,"context_line":"            # cannot PUT with an empty allocations dict."},{"line_number":176,"context_line":"            http.request(\u0027DELETE\u0027, url)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        resp \u003d http.request(\u0027GET\u0027, url).json()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_178b301e","line":175,"range":{"start_line":175,"start_character":14,"end_line":175,"end_character":55},"updated":"2019-11-14 23:19:41.000000000","message":"Pretty sure you can, certainly at 1.28+ as that\u0027s the only way we could check the consumer generation.\n\n...which appears to be missed in this method (in the existing code as well as the new). I\u0027m not sure how to feel about extending the tech debt via this patch rather than fixing that first/also.","commit_id":"9b2f9891dbee65dcd7e1c9205b762cc316c5abc5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7387dd9ded6ba0da0d7bc2bca0d14c0465c9cc34","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        else:"},{"line_number":173,"context_line":"            # The user must have removed all of the allocations using the"},{"line_number":174,"context_line":"            # --no-provider option so just DELETE the allocations since we"},{"line_number":175,"context_line":"            # cannot PUT with an empty allocations dict."},{"line_number":176,"context_line":"            http.request(\u0027DELETE\u0027, url)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        resp \u003d http.request(\u0027GET\u0027, url).json()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_8e114660","line":175,"range":{"start_line":175,"start_character":14,"end_line":175,"end_character":55},"in_reply_to":"3fa7e38b_178b301e","updated":"2019-11-15 14:12:43.000000000","message":"See my comment in the previous patch set - the new test I added failed because the \u0027allocations\u0027 dict was empty:\n\nhttps://review.opendev.org/#/c/691422/3/osc_placement/resources/allocation.py@136\n\nI originally also thought PUT /allocations/{consumer_id} would allow empty allocations because GET returns empty allocations, but I was actually thinking of POST /allocations which allows zero\u0027ing out allocations for a given consumer.","commit_id":"9b2f9891dbee65dcd7e1c9205b762cc316c5abc5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1da897299e2b10c263d3a99f89a1d82de4e8ebd5","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        else:"},{"line_number":173,"context_line":"            # The user must have removed all of the allocations using the"},{"line_number":174,"context_line":"            # --no-provider option so just DELETE the allocations since we"},{"line_number":175,"context_line":"            # cannot PUT with an empty allocations dict."},{"line_number":176,"context_line":"            http.request(\u0027DELETE\u0027, url)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        resp \u003d http.request(\u0027GET\u0027, url).json()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_37b74224","line":175,"range":{"start_line":175,"start_character":14,"end_line":175,"end_character":55},"in_reply_to":"3fa7e38b_742058b1","updated":"2019-11-15 15:17:03.000000000","message":"\u003e That\u0027s definitely not obvious from the API reference so if that\u0027s\n \u003e true there should probably be some words and/or an example in the\n \u003e PUT /allocations/{consumer_id} API reference.\n\nhttps://storyboard.openstack.org/#!/story/2006859","commit_id":"9b2f9891dbee65dcd7e1c9205b762cc316c5abc5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"469b82d1df528f586b9fa4dfd3a9f4b99c769f93","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        else:"},{"line_number":173,"context_line":"            # The user must have removed all of the allocations using the"},{"line_number":174,"context_line":"            # --no-provider option so just DELETE the allocations since we"},{"line_number":175,"context_line":"            # cannot PUT with an empty allocations dict."},{"line_number":176,"context_line":"            http.request(\u0027DELETE\u0027, url)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        resp \u003d http.request(\u0027GET\u0027, url).json()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_742058b1","line":175,"range":{"start_line":175,"start_character":14,"end_line":175,"end_character":55},"in_reply_to":"3fa7e38b_8e114660","updated":"2019-11-15 15:03:43.000000000","message":"Hmm:\n\nhttps://docs.openstack.org/placement/latest/placement-api-microversion-history.html#consumer-generation-support\n\n\"The PUT /allocations/{consumer_uuid} URI has also been modified to accept an empty allocations object, thereby bringing it to parity with the behaviour of POST /allocations, which uses an empty allocations object to indicate that the allocations for a particular consumer should be removed. Passing an empty allocations object along with a consumer_generation makes PUT /allocations/{consumer_uuid} a safe way to delete allocations for a consumer. The DELETE /allocations/{consumer_uuid} URI remains unsafe to call in deployments where multiple callers may simultaneously be attempting to modify a consumer’s allocations.\"\n\nThat\u0027s definitely not obvious from the API reference so if that\u0027s true there should probably be some words and/or an example in the PUT /allocations/{consumer_id} API reference.","commit_id":"9b2f9891dbee65dcd7e1c9205b762cc316c5abc5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6103dac23fa9617fefe0863112d26bcf451077bd","unresolved":false,"context_lines":[{"line_number":161,"context_line":"                    {\u0027resource_provider\u0027: {\u0027uuid\u0027: rp}, \u0027resources\u0027: resources}"},{"line_number":162,"context_line":"                    for rp, resources in allocations.items()]"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        supports_consumer_generation \u003d self.compare_version(version.ge(\u00271.28\u0027))"},{"line_number":165,"context_line":"        # 1.28+ allows PUTing an empty allocations dict as long as a"},{"line_number":166,"context_line":"        # consumer_generation is specified."},{"line_number":167,"context_line":"        if allocations or (not allocations and supports_consumer_generation):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_1771e60d","line":164,"updated":"2019-11-15 15:57:43.000000000","message":"Another way to do it would have been to simply modify the allocations of the payload you retrieved. That ought to work for all versions, no? (Other than still having to do the DELETE-if-empty-before-1.28 logic.)","commit_id":"c7e51861af56152374523d497e73f8441ca236dd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9d3b291c7c956bc405f76de956416ae484024ff1","unresolved":false,"context_lines":[{"line_number":161,"context_line":"                    {\u0027resource_provider\u0027: {\u0027uuid\u0027: rp}, \u0027resources\u0027: resources}"},{"line_number":162,"context_line":"                    for rp, resources in allocations.items()]"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        supports_consumer_generation \u003d self.compare_version(version.ge(\u00271.28\u0027))"},{"line_number":165,"context_line":"        # 1.28+ allows PUTing an empty allocations dict as long as a"},{"line_number":166,"context_line":"        # consumer_generation is specified."},{"line_number":167,"context_line":"        if allocations or (not allocations and supports_consumer_generation):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_63cf3c57","line":164,"in_reply_to":"3fa7e38b_1771e60d","updated":"2019-11-15 19:16:50.000000000","message":"I tried that initially but the GET and PUT weren\u0027t mirrored until 1.12 so that\u0027s why the allocations are handled separately above.","commit_id":"c7e51861af56152374523d497e73f8441ca236dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6103dac23fa9617fefe0863112d26bcf451077bd","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        else:"},{"line_number":182,"context_line":"            # The user must have removed all of the allocations using the"},{"line_number":183,"context_line":"            # --no-provider option so just DELETE the allocations since we"},{"line_number":184,"context_line":"            # cannot PUT with an empty allocations dict before 1.28."},{"line_number":185,"context_line":"            http.request(\u0027DELETE\u0027, url)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"        resp \u003d http.request(\u0027GET\u0027, url).json()"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_17d566e6","line":184,"range":{"start_line":184,"start_character":56,"end_line":184,"end_character":68},"updated":"2019-11-15 15:57:43.000000000","message":"✔","commit_id":"c7e51861af56152374523d497e73f8441ca236dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6ac845ec17d571a45c0f256598dcc8bf2b41c6f9","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            # Do not error out if the consumer does not have allocations"},{"line_number":205,"context_line":"            # against the provider in case we lost a race since the allocations"},{"line_number":206,"context_line":"            # are in the state the user wants them in anyway."},{"line_number":207,"context_line":"            allocations \u003d {"},{"line_number":208,"context_line":"                rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"},{"line_number":209,"context_line":"                for rp_uuid, alloc in old_allocations.items()"},{"line_number":210,"context_line":"                if rp_uuid not in parsed_args.provider}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_2c0d4534","line":207,"range":{"start_line":207,"start_character":12,"end_line":207,"end_character":23},"updated":"2019-11-25 17:10:33.000000000","message":"micronit: this would be (theoretically) more efficient just using one copy of the allocations and doing:\n\n for rp_uuid in parsed_args.provider:\n     allocations.pop(rp_uuid, None)\n\nBut the amount of allocation data and the size of parsed_args.provider should be so small it shouldn\u0027t matter.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5a010059ab3208af1cc1bcf0b4ed7682818a8aca","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            # Do not error out if the consumer does not have allocations"},{"line_number":205,"context_line":"            # against the provider in case we lost a race since the allocations"},{"line_number":206,"context_line":"            # are in the state the user wants them in anyway."},{"line_number":207,"context_line":"            allocations \u003d {"},{"line_number":208,"context_line":"                rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"},{"line_number":209,"context_line":"                for rp_uuid, alloc in old_allocations.items()"},{"line_number":210,"context_line":"                if rp_uuid not in parsed_args.provider}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_4c57615b","line":207,"range":{"start_line":207,"start_character":12,"end_line":207,"end_character":23},"in_reply_to":"3fa7e38b_2c0d4534","updated":"2019-11-25 17:23:04.000000000","message":"I\u0027ll see about simplifying in a follow up.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"faaa2e135d811249c3f5e7b7652f4c307345bf3f","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            # Do not error out if the consumer does not have allocations"},{"line_number":205,"context_line":"            # against the provider in case we lost a race since the allocations"},{"line_number":206,"context_line":"            # are in the state the user wants them in anyway."},{"line_number":207,"context_line":"            allocations \u003d {"},{"line_number":208,"context_line":"                rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"},{"line_number":209,"context_line":"                for rp_uuid, alloc in old_allocations.items()"},{"line_number":210,"context_line":"                if rp_uuid not in parsed_args.provider}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_ac4e1593","line":207,"range":{"start_line":207,"start_character":12,"end_line":207,"end_character":23},"in_reply_to":"3fa7e38b_4c57615b","updated":"2019-11-25 17:30:26.000000000","message":"Done","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"dd1d2d22e31c0163ffed9c243eb77bc4905cab68","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            allocations \u003d {"},{"line_number":208,"context_line":"                rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"},{"line_number":209,"context_line":"                for rp_uuid, alloc in old_allocations.items()"},{"line_number":210,"context_line":"                if rp_uuid not in parsed_args.provider}"},{"line_number":211,"context_line":"        else:"},{"line_number":212,"context_line":"            # No --provider(s) specified so remove allocations from all"},{"line_number":213,"context_line":"            # providers."}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_6dd85f7e","line":210,"range":{"start_line":210,"start_character":19,"end_line":210,"end_character":54},"updated":"2019-11-20 13:10:44.000000000","message":"Here, an element in \"parsed_args.provider\" can be an uppercase UUID while rp_uuid is always lowercase uuid. In that case, that uppercased resource provider is NOT filtered out but results in 200.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"a78466cc0bd91c005d57da7f1a668270c8ea7d1d","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            allocations \u003d {"},{"line_number":208,"context_line":"                rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"},{"line_number":209,"context_line":"                for rp_uuid, alloc in old_allocations.items()"},{"line_number":210,"context_line":"                if rp_uuid not in parsed_args.provider}"},{"line_number":211,"context_line":"        else:"},{"line_number":212,"context_line":"            # No --provider(s) specified so remove allocations from all"},{"line_number":213,"context_line":"            # providers."}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_b6e0d7cd","line":210,"range":{"start_line":210,"start_character":19,"end_line":210,"end_character":54},"in_reply_to":"3fa7e38b_198a49bb","updated":"2019-11-21 11:35:25.000000000","message":"\u003e I still don\u0027t understand the assertion that rp_uuid is always a\n \u003e lowercase uuid\n\nI thought the server lower()\u0027s it in jsonschema check to make it always lowercase.\n\n[1] https://github.com/openstack/placement/blob/bb688d7aba362ae449d1d7d2b44f08772ac393b6/placement/util.py#L40-L42\n[2] https://github.com/openstack/oslo.utils/blob/ed70bd3cd10eae2a34a5e9bd5d1fe0a6791ab3de/oslo_utils/uuidutils.py#L37-L58\n\n \u003e And even if it\u0027s always lowercase, why would someone get the output\n \u003e of say \"openstack resource provider list\" or even \"openstack\n \u003e resource provider allocation show\" and then pass the RP UUID into\n \u003e this command as uppercase?\n\nRight. I just didn\u0027t want users to be confused because of the normalization gap between the client and the server, but since this seems to be a trivial case as you say, I\u0027m okay with this.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e05e4f0d4adff9421897936373dd73913eca479e","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            allocations \u003d {"},{"line_number":208,"context_line":"                rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"},{"line_number":209,"context_line":"                for rp_uuid, alloc in old_allocations.items()"},{"line_number":210,"context_line":"                if rp_uuid not in parsed_args.provider}"},{"line_number":211,"context_line":"        else:"},{"line_number":212,"context_line":"            # No --provider(s) specified so remove allocations from all"},{"line_number":213,"context_line":"            # providers."}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_198a49bb","line":210,"range":{"start_line":210,"start_character":19,"end_line":210,"end_character":54},"in_reply_to":"3fa7e38b_6dd85f7e","updated":"2019-11-20 14:33:51.000000000","message":"I still don\u0027t understand the assertion that rp_uuid is always a lowercase uuid - it depends on the backing database on the server. And even if it\u0027s always lowercase, why would someone get the output of say \"openstack resource provider list\" or even \"openstack resource provider allocation show\" and then pass the RP UUID into this command as uppercase? I don\u0027t really think this is something worth holding up this change for client side validation of the case on a UUID - you could make the same argument everywhere in this CLI that takes a UUID and I don\u0027t think that\u0027s something we should be doing.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"dd1d2d22e31c0163ffed9c243eb77bc4905cab68","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        supports_consumer_generation \u003d self.compare_version(version.ge(\u00271.28\u0027))"},{"line_number":217,"context_line":"        # 1.28+ allows PUTing an empty allocations dict as long as a"},{"line_number":218,"context_line":"        # consumer_generation is specified."},{"line_number":219,"context_line":"        if allocations or (not allocations and supports_consumer_generation):"},{"line_number":220,"context_line":"            payload[\u0027allocations\u0027] \u003d allocations"},{"line_number":221,"context_line":"            http.request(\u0027PUT\u0027, url, json\u003dpayload)"},{"line_number":222,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_6a90454f","line":219,"range":{"start_line":219,"start_character":8,"end_line":219,"end_character":77},"updated":"2019-11-20 13:10:44.000000000","message":"...is equivalent to:\n\n  if allocations or supports_consumer_generation:","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"faaa2e135d811249c3f5e7b7652f4c307345bf3f","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        supports_consumer_generation \u003d self.compare_version(version.ge(\u00271.28\u0027))"},{"line_number":217,"context_line":"        # 1.28+ allows PUTing an empty allocations dict as long as a"},{"line_number":218,"context_line":"        # consumer_generation is specified."},{"line_number":219,"context_line":"        if allocations or (not allocations and supports_consumer_generation):"},{"line_number":220,"context_line":"            payload[\u0027allocations\u0027] \u003d allocations"},{"line_number":221,"context_line":"            http.request(\u0027PUT\u0027, url, json\u003dpayload)"},{"line_number":222,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_8cbd5969","line":219,"range":{"start_line":219,"start_character":8,"end_line":219,"end_character":77},"in_reply_to":"3fa7e38b_36f5c783","updated":"2019-11-25 17:30:26.000000000","message":"Done in a follow up.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e05e4f0d4adff9421897936373dd73913eca479e","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        supports_consumer_generation \u003d self.compare_version(version.ge(\u00271.28\u0027))"},{"line_number":217,"context_line":"        # 1.28+ allows PUTing an empty allocations dict as long as a"},{"line_number":218,"context_line":"        # consumer_generation is specified."},{"line_number":219,"context_line":"        if allocations or (not allocations and supports_consumer_generation):"},{"line_number":220,"context_line":"            payload[\u0027allocations\u0027] \u003d allocations"},{"line_number":221,"context_line":"            http.request(\u0027PUT\u0027, url, json\u003dpayload)"},{"line_number":222,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_b9bc556c","line":219,"range":{"start_line":219,"start_character":8,"end_line":219,"end_character":77},"in_reply_to":"3fa7e38b_6a90454f","updated":"2019-11-20 14:33:51.000000000","message":"True, I can fix if I respin or in a follow up. Or are you -1 until I change this?","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"a78466cc0bd91c005d57da7f1a668270c8ea7d1d","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        supports_consumer_generation \u003d self.compare_version(version.ge(\u00271.28\u0027))"},{"line_number":217,"context_line":"        # 1.28+ allows PUTing an empty allocations dict as long as a"},{"line_number":218,"context_line":"        # consumer_generation is specified."},{"line_number":219,"context_line":"        if allocations or (not allocations and supports_consumer_generation):"},{"line_number":220,"context_line":"            payload[\u0027allocations\u0027] \u003d allocations"},{"line_number":221,"context_line":"            http.request(\u0027PUT\u0027, url, json\u003dpayload)"},{"line_number":222,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_36f5c783","line":219,"range":{"start_line":219,"start_character":8,"end_line":219,"end_character":77},"in_reply_to":"3fa7e38b_b9bc556c","updated":"2019-11-21 11:35:25.000000000","message":"Nope, respin is good enough. I was -1 on the microversion gap.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6ac845ec17d571a45c0f256598dcc8bf2b41c6f9","unresolved":false,"context_lines":[{"line_number":221,"context_line":"            http.request(\u0027PUT\u0027, url, json\u003dpayload)"},{"line_number":222,"context_line":"        else:"},{"line_number":223,"context_line":"            # The user must have removed all of the allocations using the"},{"line_number":224,"context_line":"            # --no-provider option so just DELETE the allocations since we"},{"line_number":225,"context_line":"            # cannot PUT with an empty allocations dict before 1.28."},{"line_number":226,"context_line":"            http.request(\u0027DELETE\u0027, url)"},{"line_number":227,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_cc3031ec","line":224,"range":{"start_line":224,"start_character":14,"end_line":224,"end_character":34},"updated":"2019-11-25 17:10:33.000000000","message":"This is stale","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"faaa2e135d811249c3f5e7b7652f4c307345bf3f","unresolved":false,"context_lines":[{"line_number":221,"context_line":"            http.request(\u0027PUT\u0027, url, json\u003dpayload)"},{"line_number":222,"context_line":"        else:"},{"line_number":223,"context_line":"            # The user must have removed all of the allocations using the"},{"line_number":224,"context_line":"            # --no-provider option so just DELETE the allocations since we"},{"line_number":225,"context_line":"            # cannot PUT with an empty allocations dict before 1.28."},{"line_number":226,"context_line":"            http.request(\u0027DELETE\u0027, url)"},{"line_number":227,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_8c4b1985","line":224,"range":{"start_line":224,"start_character":14,"end_line":224,"end_character":34},"in_reply_to":"3fa7e38b_6c5a5d82","updated":"2019-11-25 17:30:26.000000000","message":"Done","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5a010059ab3208af1cc1bcf0b4ed7682818a8aca","unresolved":false,"context_lines":[{"line_number":221,"context_line":"            http.request(\u0027PUT\u0027, url, json\u003dpayload)"},{"line_number":222,"context_line":"        else:"},{"line_number":223,"context_line":"            # The user must have removed all of the allocations using the"},{"line_number":224,"context_line":"            # --no-provider option so just DELETE the allocations since we"},{"line_number":225,"context_line":"            # cannot PUT with an empty allocations dict before 1.28."},{"line_number":226,"context_line":"            http.request(\u0027DELETE\u0027, url)"},{"line_number":227,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_6c5a5d82","line":224,"range":{"start_line":224,"start_character":14,"end_line":224,"end_character":34},"in_reply_to":"3fa7e38b_cc3031ec","updated":"2019-11-25 17:23:04.000000000","message":"Will deal with in a follow up.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6ac845ec17d571a45c0f256598dcc8bf2b41c6f9","unresolved":false,"context_lines":[{"line_number":225,"context_line":"            # cannot PUT with an empty allocations dict before 1.28."},{"line_number":226,"context_line":"            http.request(\u0027DELETE\u0027, url)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        resp \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":229,"context_line":"        per_provider \u003d resp[\u0027allocations\u0027].items()"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"        fields \u003d (\u0027resource_provider\u0027, \u0027generation\u0027, \u0027resources\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_cc8cb181","line":228,"range":{"start_line":228,"start_character":8,"end_line":228,"end_character":46},"updated":"2019-11-25 17:10:33.000000000","message":"Mmph, if there\u0027s a race, this potentially returns something unexpected (like if another thread re-adds something for the provider I just tried to clear). But PUT doesn\u0027t return anything, even for 1.28, so I guess there\u0027s nothing to be done :(","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"}],"osc_placement/tests/functional/test_allocation.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7498b6290bf9bf4f9b937c62e4504c16c8356cc6","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        self.assertEqual(expected, created_alloc)"},{"line_number":130,"context_line":"        self.assertEqual(expected, retrieved_alloc)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    # TODO(mriedem): Test test_allocation_set_no_provider which will likely"},{"line_number":133,"context_line":"    # fail since PUT /allocations/{consumer_id} at 1.8 requires project_id and"},{"line_number":134,"context_line":"    # user_id but GET /allocations/{consumer_id} at 1.8 does not return those"},{"line_number":135,"context_line":"    # fields (they are returned in GET starting in 1.12)."}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_b7123557","line":132,"updated":"2019-10-28 20:55:34.000000000","message":"Yup:\n\n       DEBUG [placement.requestlog] Starting request: 127.0.0.1 \"PUT /placement/allocations/2b57466d-a402-4c63-8c63-7aaa816258af\"\n       DEBUG [placement.wsgi_wrapper] Placement API returning an error response: JSON does not validate: {u\u00276df1da32-3356-4af7-9efd-b87634475900\u0027: {u\u0027resources\u0027: {u\u0027VGPU\u0027: 1}}} is not of type \u0027array\u0027\n    \n    Failed validating \u0027type\u0027 in schema[\u0027properties\u0027][\u0027allocations\u0027]:\n        {\u0027items\u0027: {\u0027additionalProperties\u0027: False,\n                   \u0027properties\u0027: {\u0027resource_provider\u0027: {\u0027additionalProperties\u0027: False,\n                                                        \u0027properties\u0027: {\u0027uuid\u0027: {\u0027format\u0027: \u0027uuid\u0027,\n                                                                                \u0027type\u0027: \u0027string\u0027}},\n                                                        \u0027required\u0027: [\u0027uuid\u0027],\n                                                        \u0027type\u0027: \u0027object\u0027},\n                                  \u0027resources\u0027: {\u0027additionalProperties\u0027: False,\n                                                \u0027minProperties\u0027: 1,\n                                                \u0027patternProperties\u0027: {\u0027^[A-Z0-9_]+$\u0027: {\u0027minimum\u0027: 1,\n                                                                                       \u0027type\u0027: \u0027integer\u0027}},\n                                                \u0027type\u0027: \u0027object\u0027}},\n                   \u0027required\u0027: [\u0027resource_provider\u0027, \u0027resources\u0027],\n                   \u0027type\u0027: \u0027object\u0027},\n         \u0027minItems\u0027: 1,\n         \u0027type\u0027: \u0027array\u0027}\n    \n    On instance[\u0027allocations\u0027]:\n        {u\u00276df1da32-3356-4af7-9efd-b87634475900\u0027: {u\u0027resources\u0027: {u\u0027VGPU\u0027: 1}}}\n        INFO [placement.requestlog] 127.0.0.1 \"PUT /placement/allocations/2b57466d-a402-4c63-8c63-7aaa816258af\" status: 400 len: 1525 microversion: 1.8\n\nBut this is actually not about project_id and user_id, it\u0027s because PUT /allocations in \u003c1.12 is a different format from GET /allocations.","commit_id":"5781572d2941b587830abd108ac71af5b115751e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02af08a566b2218eba215d6b220343f13e931155","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        self.assertEqual(expected, created_alloc)"},{"line_number":250,"context_line":"        self.assertEqual(expected, retrieved_alloc)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def _create_and_add_allocation_for_second_provider("},{"line_number":253,"context_line":"            self, consumer_uuid, project_uuid, user_uuid):"},{"line_number":254,"context_line":"        # Create a second resource provider with some inventory."},{"line_number":255,"context_line":"        rp2 \u003d self.resource_provider_create()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_3cd8931c","line":252,"updated":"2019-11-14 21:56:45.000000000","message":"In a follow up I think we could DRY up this helper and the two tests below for all 3 test classes using a mixin.","commit_id":"9b2f9891dbee65dcd7e1c9205b762cc316c5abc5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6ac845ec17d571a45c0f256598dcc8bf2b41c6f9","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        self.consumer_uuid \u003d str(uuid.uuid4())"},{"line_number":196,"context_line":"        self.project_uuid \u003d str(uuid.uuid4())"},{"line_number":197,"context_line":"        self.user_uuid \u003d str(uuid.uuid4())"},{"line_number":198,"context_line":"        # TODO(mriedem): Restrict allocation set to 1.12 until it supports"},{"line_number":199,"context_line":"        # 1.28 and consumer generations."},{"line_number":200,"context_line":"        test_version \u003d self.VERSION"},{"line_number":201,"context_line":"        self.VERSION \u003d \u00271.12\u0027"},{"line_number":202,"context_line":"        try:"},{"line_number":203,"context_line":"            self.resource_allocation_set("},{"line_number":204,"context_line":"                self.consumer_uuid,"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_ecf88dc1","line":201,"range":{"start_line":198,"start_character":0,"end_line":201,"end_character":29},"updated":"2019-11-25 17:10:33.000000000","message":"removed in the next patch ✔","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6ac845ec17d571a45c0f256598dcc8bf2b41c6f9","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            self.consumer_uuid, provider\u003dself.rp1[\u0027uuid\u0027])"},{"line_number":217,"context_line":"        expected \u003d ["},{"line_number":218,"context_line":"            {\u0027resource_provider\u0027: self.rp2[\u0027uuid\u0027],"},{"line_number":219,"context_line":"             \u0027generation\u0027: 3,"},{"line_number":220,"context_line":"             \u0027project_id\u0027: self.project_uuid,"},{"line_number":221,"context_line":"             \u0027user_id\u0027: self.user_uuid,"},{"line_number":222,"context_line":"             \u0027resources\u0027: {\u0027VGPU\u0027: 1}}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_6c26dd69","line":219,"range":{"start_line":219,"start_character":27,"end_line":219,"end_character":29},"updated":"2019-11-25 17:10:33.000000000","message":":(","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"66563df3eb1157fa6ac856d74fee383182847ee4","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            self.consumer_uuid, provider\u003dself.rp1[\u0027uuid\u0027])"},{"line_number":217,"context_line":"        expected \u003d ["},{"line_number":218,"context_line":"            {\u0027resource_provider\u0027: self.rp2[\u0027uuid\u0027],"},{"line_number":219,"context_line":"             \u0027generation\u0027: 3,"},{"line_number":220,"context_line":"             \u0027project_id\u0027: self.project_uuid,"},{"line_number":221,"context_line":"             \u0027user_id\u0027: self.user_uuid,"},{"line_number":222,"context_line":"             \u0027resources\u0027: {\u0027VGPU\u0027: 1}}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_27f31ee9","line":219,"range":{"start_line":219,"start_character":27,"end_line":219,"end_character":29},"in_reply_to":"3fa7e38b_2c71c5de","updated":"2019-11-25 17:50:09.000000000","message":"Yeah. The cure is worse than the disease, so I\u0027m okay leaving it alone.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5a010059ab3208af1cc1bcf0b4ed7682818a8aca","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            self.consumer_uuid, provider\u003dself.rp1[\u0027uuid\u0027])"},{"line_number":217,"context_line":"        expected \u003d ["},{"line_number":218,"context_line":"            {\u0027resource_provider\u0027: self.rp2[\u0027uuid\u0027],"},{"line_number":219,"context_line":"             \u0027generation\u0027: 3,"},{"line_number":220,"context_line":"             \u0027project_id\u0027: self.project_uuid,"},{"line_number":221,"context_line":"             \u0027user_id\u0027: self.user_uuid,"},{"line_number":222,"context_line":"             \u0027resources\u0027: {\u0027VGPU\u0027: 1}}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_8c61d93b","line":219,"range":{"start_line":219,"start_character":27,"end_line":219,"end_character":29},"in_reply_to":"3fa7e38b_6c26dd69","updated":"2019-11-25 17:23:04.000000000","message":"What?","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"faaa2e135d811249c3f5e7b7652f4c307345bf3f","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            self.consumer_uuid, provider\u003dself.rp1[\u0027uuid\u0027])"},{"line_number":217,"context_line":"        expected \u003d ["},{"line_number":218,"context_line":"            {\u0027resource_provider\u0027: self.rp2[\u0027uuid\u0027],"},{"line_number":219,"context_line":"             \u0027generation\u0027: 3,"},{"line_number":220,"context_line":"             \u0027project_id\u0027: self.project_uuid,"},{"line_number":221,"context_line":"             \u0027user_id\u0027: self.user_uuid,"},{"line_number":222,"context_line":"             \u0027resources\u0027: {\u0027VGPU\u0027: 1}}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_2c71c5de","line":219,"range":{"start_line":219,"start_character":27,"end_line":219,"end_character":29},"in_reply_to":"3fa7e38b_8c61d93b","updated":"2019-11-25 17:30:26.000000000","message":"Oh that it\u0027s hard-coded and thus assumes we can predict what it\u0027s going to be.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"}],"osc_placement/version.py":[{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"dd1d2d22e31c0163ffed9c243eb77bc4905cab68","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    \u00271.20\u0027,  # unused"},{"line_number":39,"context_line":"    \u00271.21\u0027,"},{"line_number":40,"context_line":"    \u00271.22\u0027,"},{"line_number":41,"context_line":"    \u00271.28\u0027,  # Added for provider allocation unset (Ussuri)"},{"line_number":42,"context_line":"]"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_befd1b09","line":41,"updated":"2019-11-20 13:10:44.000000000","message":"I got the path and the test for 1.28 added in this patch works thanks to the following patch [1]. This is fine.\n\n[1] https://review.opendev.org/#/c/695048/1\n\nBut we have to support 1.23-1.27 before we actually support 1.28, right?","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"a78466cc0bd91c005d57da7f1a668270c8ea7d1d","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    \u00271.20\u0027,  # unused"},{"line_number":39,"context_line":"    \u00271.21\u0027,"},{"line_number":40,"context_line":"    \u00271.22\u0027,"},{"line_number":41,"context_line":"    \u00271.28\u0027,  # Added for provider allocation unset (Ussuri)"},{"line_number":42,"context_line":"]"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_16268b17","line":41,"in_reply_to":"3fa7e38b_99b71986","updated":"2019-11-21 11:35:25.000000000","message":"...but assuming it is okay to have gaps since user can opt things, this change looks good to me. Thanks for addressing my comments.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e05e4f0d4adff9421897936373dd73913eca479e","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    \u00271.20\u0027,  # unused"},{"line_number":39,"context_line":"    \u00271.21\u0027,"},{"line_number":40,"context_line":"    \u00271.22\u0027,"},{"line_number":41,"context_line":"    \u00271.28\u0027,  # Added for provider allocation unset (Ussuri)"},{"line_number":42,"context_line":"]"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_99b71986","line":41,"in_reply_to":"3fa7e38b_befd1b09","updated":"2019-11-20 14:33:51.000000000","message":"\u003e But we have to support 1.23-1.27 before we actually support 1.28,\n \u003e right?\n\nNo, that\u0027s not really how OSC works since it defaults to the base microversion (1.0) and the user has to opt into whatever version they want to use. python-novaclient is different in that it defaults to the highest negotiated version between the client and server for the CLI (but not the API bindings in novaclient). So we can have gaps in OSC - see how many there are for the compute API in base OSC:\n\nhttps://etherpad.openstack.org/p/compute-api-microversion-gap-in-osc","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"}],"releasenotes/notes/allocation-set-no-provider-beb0d904c8bc4228.yaml":[{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"f13a92f0c5c37f26d34a58c11e6081a591c91429","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    A new ``--no-provider`` option is added to the"},{"line_number":5,"context_line":"    ``openstack resource provider allocation set`` command which is mutually"},{"line_number":6,"context_line":"    excluse with the ``--allocation`` option and will allow removing a specific"},{"line_number":7,"context_line":"    resource provider from the set of allocations for the given consumer."},{"line_number":8,"context_line":"    This can be useful when a consumer has allocations against more than one"},{"line_number":9,"context_line":"    resource provider and ``openstack resource provider allocation delete``"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3fa7e38b_9bd038ca","line":6,"range":{"start_line":6,"start_character":4,"end_line":6,"end_character":11},"updated":"2019-11-04 01:08:46.000000000","message":"exclusive","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02af08a566b2218eba215d6b220343f13e931155","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    A new ``--no-provider`` option is added to the"},{"line_number":5,"context_line":"    ``openstack resource provider allocation set`` command which is mutually"},{"line_number":6,"context_line":"    excluse with the ``--allocation`` option and will allow removing a specific"},{"line_number":7,"context_line":"    resource provider from the set of allocations for the given consumer."},{"line_number":8,"context_line":"    This can be useful when a consumer has allocations against more than one"},{"line_number":9,"context_line":"    resource provider and ``openstack resource provider allocation delete``"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3fa7e38b_dcccdfbc","line":6,"range":{"start_line":6,"start_character":4,"end_line":6,"end_character":11},"in_reply_to":"3fa7e38b_9bd038ca","updated":"2019-11-14 21:56:45.000000000","message":"Done","commit_id":"c1474f979d00031f3f864fb6ac95082957bce357"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"383889e891363c1a89d059c245fd86ded2fc9d6a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    A new ``openstack resource provider allocation unset`` command has been"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"3fa7e38b_7f3a4c98","line":1,"updated":"2019-11-19 17:37:42.000000000","message":"I should rename this.","commit_id":"151321698a1c8897031d1365846b65d2ef8fb9e5"}],"releasenotes/notes/allocation-unset-beb0d904c8bc4228.yaml":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6ac845ec17d571a45c0f256598dcc8bf2b41c6f9","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    A new ``openstack resource provider allocation unset`` command has been"},{"line_number":5,"context_line":"    added which allows removing resource provider(s) from the set of"},{"line_number":6,"context_line":"    allocations for the given consumer. This can be useful when a consumer has"},{"line_number":7,"context_line":"    allocations against more than one resource provider and"},{"line_number":8,"context_line":"    ``openstack resource provider allocation delete`` is undesirable as it"},{"line_number":9,"context_line":"    removes all allocations for the consumer. The new unset command requires"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"3fa7e38b_6cb49df1","line":6,"range":{"start_line":5,"start_character":23,"end_line":6,"end_character":38},"updated":"2019-11-25 17:10:33.000000000","message":"Nit, allocations don\u0027t have resource providers, suggest \"removing allocations against specific resource providers for the given consumer\"","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5a010059ab3208af1cc1bcf0b4ed7682818a8aca","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    A new ``openstack resource provider allocation unset`` command has been"},{"line_number":5,"context_line":"    added which allows removing resource provider(s) from the set of"},{"line_number":6,"context_line":"    allocations for the given consumer. This can be useful when a consumer has"},{"line_number":7,"context_line":"    allocations against more than one resource provider and"},{"line_number":8,"context_line":"    ``openstack resource provider allocation delete`` is undesirable as it"},{"line_number":9,"context_line":"    removes all allocations for the consumer. The new unset command requires"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"3fa7e38b_6ccfbd27","line":6,"range":{"start_line":5,"start_character":23,"end_line":6,"end_character":38},"in_reply_to":"3fa7e38b_6cb49df1","updated":"2019-11-25 17:23:04.000000000","message":"Can do in a follow up.","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"faaa2e135d811249c3f5e7b7652f4c307345bf3f","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    A new ``openstack resource provider allocation unset`` command has been"},{"line_number":5,"context_line":"    added which allows removing resource provider(s) from the set of"},{"line_number":6,"context_line":"    allocations for the given consumer. This can be useful when a consumer has"},{"line_number":7,"context_line":"    allocations against more than one resource provider and"},{"line_number":8,"context_line":"    ``openstack resource provider allocation delete`` is undesirable as it"},{"line_number":9,"context_line":"    removes all allocations for the consumer. The new unset command requires"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"3fa7e38b_ac65b51e","line":6,"range":{"start_line":5,"start_character":23,"end_line":6,"end_character":38},"in_reply_to":"3fa7e38b_6ccfbd27","updated":"2019-11-25 17:30:26.000000000","message":"Done","commit_id":"9b86d945594bd22980dcf76ebcb8fb5112d471ed"}]}
