)]}'
{"osc_placement/resources/allocation.py":[{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"287b03b361d0a6e10616248bc828da10e401db47","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if supports_consumer_generation:"},{"line_number":109,"context_line":"            # Get the existing consumer generation via GET."},{"line_number":110,"context_line":"            payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":111,"context_line":"            consumer_generation \u003d payload.get(\u0027consumer_generation\u0027)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        allocations \u003d parse_allocations(parsed_args.allocation)"},{"line_number":114,"context_line":"        if not allocations:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_8bc0114c","line":111,"updated":"2019-11-21 12:12:53.000000000","message":"An alternative is to expose it to users to have users manually set the consumer_generation, but this is enough since the other services go this way as well.","commit_id":"0acbe401c57ea930293d3c6bef7d0a9d54bcbf4d"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"7e566194a9e6b9fc15c02ec4a0e880288ca72799","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if supports_consumer_generation:"},{"line_number":109,"context_line":"            # Get the existing consumer generation via GET."},{"line_number":110,"context_line":"            payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":111,"context_line":"            consumer_generation \u003d payload.get(\u0027consumer_generation\u0027)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        allocations \u003d parse_allocations(parsed_args.allocation)"},{"line_number":114,"context_line":"        if not allocations:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_43e74e10","line":111,"in_reply_to":"3fa7e38b_3ddb51ea","updated":"2019-11-22 06:24:40.000000000","message":"Let\u0027s discuss this in another patch, since this should be done in set/unset/show at once if we want. https://review.opendev.org/695629","commit_id":"0acbe401c57ea930293d3c6bef7d0a9d54bcbf4d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0cf1d6e53689ee652df76d209fec4ff25a3e875c","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if supports_consumer_generation:"},{"line_number":109,"context_line":"            # Get the existing consumer generation via GET."},{"line_number":110,"context_line":"            payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":111,"context_line":"            consumer_generation \u003d payload.get(\u0027consumer_generation\u0027)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        allocations \u003d parse_allocations(parsed_args.allocation)"},{"line_number":114,"context_line":"        if not allocations:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_c376edd8","line":111,"in_reply_to":"3fa7e38b_83f9d54e","updated":"2019-11-21 14:26:55.000000000","message":"Note that resource provider inventory set doesn\u0027t take a generation option either.","commit_id":"0acbe401c57ea930293d3c6bef7d0a9d54bcbf4d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"eefd1873c286ee24166b8d7c1f7f8948ef9261dd","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if supports_consumer_generation:"},{"line_number":109,"context_line":"            # Get the existing consumer generation via GET."},{"line_number":110,"context_line":"            payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":111,"context_line":"            consumer_generation \u003d payload.get(\u0027consumer_generation\u0027)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        allocations \u003d parse_allocations(parsed_args.allocation)"},{"line_number":114,"context_line":"        if not allocations:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_83f9d54e","line":111,"in_reply_to":"3fa7e38b_8bc0114c","updated":"2019-11-21 14:25:13.000000000","message":"I don\u0027t think we want users to have to pass in generations on the command line. Computers can track that stuff, humans shouldn\u0027t have to on the command line.","commit_id":"0acbe401c57ea930293d3c6bef7d0a9d54bcbf4d"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"68b542f1ce54449a33c37541be57f838ee8e392a","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if supports_consumer_generation:"},{"line_number":109,"context_line":"            # Get the existing consumer generation via GET."},{"line_number":110,"context_line":"            payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":111,"context_line":"            consumer_generation \u003d payload.get(\u0027consumer_generation\u0027)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        allocations \u003d parse_allocations(parsed_args.allocation)"},{"line_number":114,"context_line":"        if not allocations:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_3ddb51ea","line":111,"in_reply_to":"3fa7e38b_c376edd8","updated":"2019-11-22 01:23:35.000000000","message":"Note that resource provider inventory set doesn\u0027t take a generation option either but does display the rp generation.","commit_id":"0acbe401c57ea930293d3c6bef7d0a9d54bcbf4d"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"287b03b361d0a6e10616248bc828da10e401db47","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        fields \u003d (\u0027resource_provider\u0027, \u0027generation\u0027, \u0027resources\u0027)"},{"line_number":144,"context_line":"        allocs \u003d [dict(resource_provider\u003dk, **v) for k, v in per_provider]"},{"line_number":145,"context_line":"        if self.compare_version(version.ge(\u00271.12\u0027)):"},{"line_number":146,"context_line":"            fields +\u003d (\u0027project_id\u0027, \u0027user_id\u0027)"},{"line_number":147,"context_line":"            [alloc.update(project_id\u003dresp[\u0027project_id\u0027],"},{"line_number":148,"context_line":"                          user_id\u003dresp[\u0027user_id\u0027])"},{"line_number":149,"context_line":"             for alloc in allocs]"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        rows \u003d (utils.get_dict_properties(a, fields) for a in allocs)"},{"line_number":152,"context_line":"        return fields, rows"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_4bc1b9e3","line":149,"range":{"start_line":145,"start_character":8,"end_line":149,"end_character":33},"updated":"2019-11-21 12:12:53.000000000","message":"Can we add and display new \"consumer_generation\" like this for \u003e 1.28?","commit_id":"0acbe401c57ea930293d3c6bef7d0a9d54bcbf4d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"eefd1873c286ee24166b8d7c1f7f8948ef9261dd","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        fields \u003d (\u0027resource_provider\u0027, \u0027generation\u0027, \u0027resources\u0027)"},{"line_number":144,"context_line":"        allocs \u003d [dict(resource_provider\u003dk, **v) for k, v in per_provider]"},{"line_number":145,"context_line":"        if self.compare_version(version.ge(\u00271.12\u0027)):"},{"line_number":146,"context_line":"            fields +\u003d (\u0027project_id\u0027, \u0027user_id\u0027)"},{"line_number":147,"context_line":"            [alloc.update(project_id\u003dresp[\u0027project_id\u0027],"},{"line_number":148,"context_line":"                          user_id\u003dresp[\u0027user_id\u0027])"},{"line_number":149,"context_line":"             for alloc in allocs]"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        rows \u003d (utils.get_dict_properties(a, fields) for a in allocs)"},{"line_number":152,"context_line":"        return fields, rows"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_039ba516","line":149,"range":{"start_line":145,"start_character":8,"end_line":149,"end_character":33},"in_reply_to":"3fa7e38b_4bc1b9e3","updated":"2019-11-21 14:25:13.000000000","message":"I don\u0027t think we want to do that because as noted above, I don\u0027t think we want to take generations as input on a CLI.","commit_id":"0acbe401c57ea930293d3c6bef7d0a9d54bcbf4d"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"287b03b361d0a6e10616248bc828da10e401db47","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        return fields, rows"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"class ShowAllocation(command.Lister, version.CheckerMixin):"},{"line_number":253,"context_line":"    \"\"\"Show resource allocations for a given consumer."},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    Starting with ``--os-placement-api-version 1.12`` the API response contains"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_6b7cb5b5","line":252,"range":{"start_line":252,"start_character":6,"end_line":252,"end_character":20},"updated":"2019-11-21 12:12:53.000000000","message":"I\u0027m never -1 for this, but updating this as well is not a big deal.","commit_id":"0acbe401c57ea930293d3c6bef7d0a9d54bcbf4d"}],"osc_placement/tests/functional/test_allocation.py":[{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"287b03b361d0a6e10616248bc828da10e401db47","unresolved":false,"context_lines":[{"line_number":205,"context_line":"            project_id\u003dproject_uuid, user_id\u003duser_uuid"},{"line_number":206,"context_line":"        )"},{"line_number":207,"context_line":"        expected[0].update({"},{"line_number":208,"context_line":"            \u0027generation\u0027: expected[0][\u0027generation\u0027] + 1,"},{"line_number":209,"context_line":"            \u0027resources\u0027: {\u0027VCPU\u0027: 4, \u0027MEMORY_MB\u0027: 1024}"},{"line_number":210,"context_line":"        })"},{"line_number":211,"context_line":"        self.assertEqual(expected, updated_alloc)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_cbe129fe","line":208,"range":{"start_line":208,"start_character":11,"end_line":208,"end_character":56},"updated":"2019-11-21 12:12:53.000000000","message":"note: this generation is not of the consumer but of the resource provider. Ideally we want a test to reproduce 409 with the racy condition, but since it is difficult from client side, this looks good enough to me.","commit_id":"0acbe401c57ea930293d3c6bef7d0a9d54bcbf4d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ffdfae0190b80d9f5d85d7d2d99b9c8f3b444cd4","unresolved":false,"context_lines":[{"line_number":205,"context_line":"            project_id\u003dproject_uuid, user_id\u003duser_uuid"},{"line_number":206,"context_line":"        )"},{"line_number":207,"context_line":"        expected[0].update({"},{"line_number":208,"context_line":"            \u0027generation\u0027: expected[0][\u0027generation\u0027] + 1,"},{"line_number":209,"context_line":"            \u0027resources\u0027: {\u0027VCPU\u0027: 4, \u0027MEMORY_MB\u0027: 1024}"},{"line_number":210,"context_line":"        })"},{"line_number":211,"context_line":"        self.assertEqual(expected, updated_alloc)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_a1dffe09","line":208,"range":{"start_line":208,"start_character":11,"end_line":208,"end_character":56},"in_reply_to":"3fa7e38b_63c139e4","updated":"2019-11-25 16:39:50.000000000","message":"I don\u0027t like that we\u0027re explicitly expecting the generation to be incremented by one. That\u0027s relying too much on the internals of how placement deals with generations, which (although it\u0027s not likely to happen) we have reserved the right to change without a microversion (to e.g. use random numbers or hashes or whatever).\n\nIt would be better simply to assert that the new generation is not equal to the old generation. But that\u0027s a bit of a PITA to do.\n\nSo I\u0027m okay with the (negligible) risk that Placement will break this in the future and we\u0027ll have to fix it.","commit_id":"0acbe401c57ea930293d3c6bef7d0a9d54bcbf4d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"eefd1873c286ee24166b8d7c1f7f8948ef9261dd","unresolved":false,"context_lines":[{"line_number":205,"context_line":"            project_id\u003dproject_uuid, user_id\u003duser_uuid"},{"line_number":206,"context_line":"        )"},{"line_number":207,"context_line":"        expected[0].update({"},{"line_number":208,"context_line":"            \u0027generation\u0027: expected[0][\u0027generation\u0027] + 1,"},{"line_number":209,"context_line":"            \u0027resources\u0027: {\u0027VCPU\u0027: 4, \u0027MEMORY_MB\u0027: 1024}"},{"line_number":210,"context_line":"        })"},{"line_number":211,"context_line":"        self.assertEqual(expected, updated_alloc)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_63c139e4","line":208,"range":{"start_line":208,"start_character":11,"end_line":208,"end_character":56},"in_reply_to":"3fa7e38b_cbe129fe","updated":"2019-11-21 14:25:13.000000000","message":"That 409 race would have to be mocked b/c it\u0027s a super tight window to hit that with how this command works.","commit_id":"0acbe401c57ea930293d3c6bef7d0a9d54bcbf4d"}]}
