)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9b2a6fe8affe6334d9dde466c11b78e3e2e0e20e","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"Note: Previously server_group_member were counted per user inside each"},{"line_number":45,"context_line":"server_group, which has proved very confusing, as adding more users into"},{"line_number":46,"context_line":"a project increases the maximum size of allowed for a server_group."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"blueprint unified-limits-nova"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"df33271e_059724ee","line":46,"updated":"2020-03-31 07:41:58.000000000","message":"So an existing limit configuration will now have a different meaning if the UnifiedLimitDriver is used. We need to warn the deployers about such change of the meaning of the default values in the conf.","commit_id":"1b83d666e46f11ffeea224c6ff878a66aa0b6247"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"3026693d9d46392fc78bb72d47f16dc9fe31d71d","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"Note: Previously server_group_member were counted per user inside each"},{"line_number":45,"context_line":"server_group, which has proved very confusing, as adding more users into"},{"line_number":46,"context_line":"a project increases the maximum size of allowed for a server_group."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"blueprint unified-limits-nova"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"df33271e_dca3459d","line":46,"in_reply_to":"df33271e_059724ee","updated":"2020-03-31 08:46:23.000000000","message":"Yes agreed, its currently in a reno in the last patch. Might be better to update a single reno as I go I guess?\n\nAlso, you are quite right that we need something in the configuration. The spec suggested a spearate use_unified_limits \u003d True, but I am not quite sure its ready for that yet. Lets see what you think.","commit_id":"1b83d666e46f11ffeea224c6ff878a66aa0b6247"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"90db6b16d3494a07ff48e5da2965e3cd26ebf2b4","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"Note: Previously server_group_member were counted per user inside each"},{"line_number":45,"context_line":"server_group, which has proved very confusing, as adding more users into"},{"line_number":46,"context_line":"a project increases the maximum size of allowed for a server_group."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"blueprint unified-limits-nova"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"df33271e_28f5a6ed","line":46,"in_reply_to":"df33271e_dca3459d","updated":"2020-04-01 13:30:26.000000000","message":"\u003e Yes agreed, its currently in a reno in the last patch. Might be\n \u003e better to update a single reno as I go I guess?\n \u003e \n\nI\u0027m OK to get this documented in the last patch. Now I looked at the reno and it seems OK to me.\n\n \u003e Also, you are quite right that we need something in the\n \u003e configuration. The spec suggested a spearate use_unified_limits \u003d\n \u003e True, but I am not quite sure its ready for that yet. Lets see what\n \u003e you think.\n\nAs far as I understand currently we turn this WIP feature in by setting the quote/driver to the new UnifiedLimitsDriver. I think that feature flag is enough. We don\u0027t need another.","commit_id":"1b83d666e46f11ffeea224c6ff878a66aa0b6247"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"cb6d15c51e3566e7e1026979efadcee91546c1e1","unresolved":true,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"We are not moving all existing quotas to be managed via Keystone\u0027s"},{"line_number":19,"context_line":"unified limits. Many of the quotas that we previously allowed to be"},{"line_number":20,"context_line":"overridden via the database, will now only be set via Nova"},{"line_number":21,"context_line":"configuration."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"These limits are all about preventing excessive load on the API and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"10d94745_04850a7d","line":20,"range":{"start_line":20,"start_character":27,"end_line":20,"end_character":28},"updated":"2021-05-10 16:43:51.000000000","message":"nit: drop","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"We are not moving all existing quotas to be managed via Keystone\u0027s"},{"line_number":19,"context_line":"unified limits. Many of the quotas that we previously allowed to be"},{"line_number":20,"context_line":"overridden via the database, will now only be set via Nova"},{"line_number":21,"context_line":"configuration."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"These limits are all about preventing excessive load on the API and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"903634ce_8a3cd67c","line":20,"range":{"start_line":20,"start_character":27,"end_line":20,"end_character":28},"in_reply_to":"10d94745_04850a7d","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f93000505d61e965eb29d94bc53ff0a6513d1215","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":23,"id":"6b8deec4_67b9537a","updated":"2021-11-11 04:22:15.000000000","message":"Failures are legit, need to figure out","commit_id":"87070216c88db5990fca6eb05ff3fa7a4686b451"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a5663137dd77c4c1d9019c5b6521b3c8a230d01b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":23,"id":"6b339469_df37032f","updated":"2021-11-10 23:23:31.000000000","message":"recheck","commit_id":"87070216c88db5990fca6eb05ff3fa7a4686b451"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1a792d93f1168e010ac25b7ee62a80c765b833c4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":25,"id":"32dc10de_c335dfbc","updated":"2022-01-07 18:59:56.000000000","message":"I haven\u0027t gone through the tests again yet, but I had a bunch of comments on this earlier based on how we were using oslo.limit. The current revision looks good (as in way better) to me. I\u0027m still working up the stack but I\u0027m throwing a +1 on here to indicate I\u0027m good with how this ended up.","commit_id":"6a5dd4de7ce0dd7476d7ec5afcc411b14dc68e38"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"404e444b2bd6f08a9e8bd8b419f862a0ce7ff577","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":26,"id":"4058bc82_0b16344f","updated":"2022-01-21 19:51:21.000000000","message":"recheck bug 1957941","commit_id":"9073ecf57e1e1ea8aa2bd5625b2e5d53d5bc547c"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ce41cc901db112376acd27b1644fc249031d41fe","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":26,"id":"34b51461_b4217e59","updated":"2022-01-21 00:49:33.000000000","message":"recheck dep updated","commit_id":"9073ecf57e1e1ea8aa2bd5625b2e5d53d5bc547c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2619e759a5b6eb49fd954cb7517c1da7532ecc2f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":27,"id":"5b28f9fe_1d4fe595","updated":"2022-01-31 18:01:44.000000000","message":"Got to the tests, which I hadn\u0027t done before. A question inline, but otherwise good.","commit_id":"d15e72ca42e96c8de14712ea90a33bbb9a33367f"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"09b2b5eb5a39992d22d96010f89b138a2fb6e2cd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":27,"id":"be5199e4_d1eb1986","updated":"2022-01-27 19:58:28.000000000","message":"recheck test_live_migration_with_trunk subport did not become ACTIVE after live migration","commit_id":"d15e72ca42e96c8de14712ea90a33bbb9a33367f"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7f81f7cf3d17b9b51772d10fe65cf050d4bc3e96","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":28,"id":"53fc6d5f_f69da83c","updated":"2022-02-08 10:35:41.000000000","message":"+2 but I\u0027d appreciate before merging that we could somehow document the notion of API limits","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7ab9819189d34e66b470d91f0964e58695dcc225","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":28,"id":"d19a24e7_ff8ebe9f","updated":"2022-02-08 15:08:56.000000000","message":"Melanie and I discussed changing approach to a few things yesterday, which I\u0027ve started working on. I expect one of us will push up a change to this today, so I\u0027m dropping a -1 on here for visibility.","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"80d74d13cf07046698a70a973f406997ab9f6ac2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":28,"id":"68e8b0b5_a9fa5f7c","updated":"2022-02-02 13:48:22.000000000","message":"looks good to me","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1ee3a58ac7b7875393be0ad0fc2863d6c0550c53","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":28,"id":"c9aba5f2_81f1324f","updated":"2022-02-02 13:21:45.000000000","message":"recheck nova-next should pass now as the tempest fix[1] has been merged.\n[1] https://review.opendev.org/c/openstack/tempest/+/827258","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3d65a5d4d14e396e6cd1a0ae8cdc01c78f42d195","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":31,"id":"08c719a3_f7b664d1","updated":"2022-02-10 16:35:13.000000000","message":"Thanks for fixing the testcase up.","commit_id":"8327d8260495669b411273ab41a6fbd260fb7479"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8e50ce84022e6f8b75bfe13509f064691b952b8f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":32,"id":"ee6bc8ae_8545f305","updated":"2022-02-24 16:32:28.000000000","message":"Cleare merge conflict resolution fast approving.","commit_id":"3b69f959a848bad257f186f491111658b25f24c7"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"3bd53f4755e76560763bacd942a5c886b3083f21","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":32,"id":"151b3f91_7ed000f0","updated":"2022-02-25 15:48:03.000000000","message":"recheck","commit_id":"3b69f959a848bad257f186f491111658b25f24c7"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ed425fa5a15f61f2a71301c01345b55602cda2ab","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":32,"id":"4597d65f_d82a1731","updated":"2022-02-24 22:04:23.000000000","message":"recheck","commit_id":"3b69f959a848bad257f186f491111658b25f24c7"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"6df6ec16e8bfeaa3880e5a55aeeaeb076fcf0bbb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":32,"id":"edab4618_8b480ee3","updated":"2022-02-25 12:49:41.000000000","message":"recheck","commit_id":"3b69f959a848bad257f186f491111658b25f24c7"}],"nova/conf/quota.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"3f68dad87eed9d506e6ec727d89db99ea70c4714","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        min\u003d-1,"},{"line_number":117,"context_line":"        default\u003d255,"},{"line_number":118,"context_line":"        deprecated_opts\u003d["},{"line_number":119,"context_line":"            cfg.DeprecatedOpt(\"quota_injected_file_path_length\","},{"line_number":120,"context_line":"                              group\u003d\"DEFAULT\"),"},{"line_number":121,"context_line":"            cfg.DeprecatedOpt(\"injected_file_path_length\"),"},{"line_number":122,"context_line":"        ],"},{"line_number":123,"context_line":"        help\u003d\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_b916c9f0","line":120,"range":{"start_line":119,"start_character":0,"end_line":120,"end_character":47},"updated":"2020-06-10 13:30:46.000000000","message":"A precursor patch to just remove this old deprecation would also be suitable, nay, preferable","commit_id":"72ae800be04b1f180add106636f8b3b62b0f6d78"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"3785d13b0dff13aa66e45693efe88e412b347f59","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        min\u003d-1,"},{"line_number":117,"context_line":"        default\u003d255,"},{"line_number":118,"context_line":"        deprecated_opts\u003d["},{"line_number":119,"context_line":"            cfg.DeprecatedOpt(\"quota_injected_file_path_length\","},{"line_number":120,"context_line":"                              group\u003d\"DEFAULT\"),"},{"line_number":121,"context_line":"            cfg.DeprecatedOpt(\"injected_file_path_length\"),"},{"line_number":122,"context_line":"        ],"},{"line_number":123,"context_line":"        help\u003d\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"bf51134e_4498d668","line":120,"range":{"start_line":119,"start_character":0,"end_line":120,"end_character":47},"in_reply_to":"ff570b3c_b916c9f0","updated":"2020-06-24 21:48:30.000000000","message":"IMO, we should wait and remove both deprecated one once so that users of both old can switch to latest new one in easy way.","commit_id":"72ae800be04b1f180add106636f8b3b62b0f6d78"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"cb6d15c51e3566e7e1026979efadcee91546c1e1","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            cfg.DeprecatedOpt(\"quota_injected_file_path_length\","},{"line_number":120,"context_line":"                              group\u003d\"DEFAULT\"),"},{"line_number":121,"context_line":"            cfg.DeprecatedOpt(\"injected_file_path_length\"),"},{"line_number":122,"context_line":"        ],"},{"line_number":123,"context_line":"        help\u003d\"\"\""},{"line_number":124,"context_line":"The maximum allowed injected file path length."},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"c2997341_9b2a6fcb","line":122,"updated":"2021-05-10 16:43:51.000000000","message":"tbh, you could simplify this by dropping the (ancient) alias in a separate precursor patch, since any responsible adult would have switched over long ago. This also works though","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4f80fe91c45402cdee58fa5f4e81543dece154e6","unresolved":true,"context_lines":[{"line_number":112,"context_line":"* A positive integer or 0."},{"line_number":113,"context_line":"* -1 to disable the quota."},{"line_number":114,"context_line":"\"\"\"),"},{"line_number":115,"context_line":"    cfg.IntOpt(\u0027injected_file_path_bytes\u0027,"},{"line_number":116,"context_line":"        min\u003d-1,"},{"line_number":117,"context_line":"        default\u003d255,"},{"line_number":118,"context_line":"        deprecated_opts\u003d["}],"source_content_type":"text/x-python","patch_set":14,"id":"3a5385c8_131778ab","line":115,"updated":"2021-08-31 18:49:34.000000000","message":"This needs to change why exactly? I assume it\u0027s because you want this to match the value in keystone, but changing it (for a third time) seems overkill. We could just translate this name to the keystone name if we do that lookup and avoid creating more config file debt right? In the next patch you have a legacy limit name translation dict...","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"90ca72b912a0d453041f77e08db34ac1a7f25889","unresolved":true,"context_lines":[{"line_number":112,"context_line":"* A positive integer or 0."},{"line_number":113,"context_line":"* -1 to disable the quota."},{"line_number":114,"context_line":"\"\"\"),"},{"line_number":115,"context_line":"    cfg.IntOpt(\u0027injected_file_path_bytes\u0027,"},{"line_number":116,"context_line":"        min\u003d-1,"},{"line_number":117,"context_line":"        default\u003d255,"},{"line_number":118,"context_line":"        deprecated_opts\u003d["}],"source_content_type":"text/x-python","patch_set":14,"id":"7964eab7_28a4e2ab","line":115,"in_reply_to":"3a5385c8_131778ab","updated":"2021-08-31 19:05:48.000000000","message":"This is a remnant from the original config option based proposal and I wasn\u0027t 100% sure what to do with it and erred on the side of leaving it for review.\n\nI think what you\u0027re saying sounds right, that we can use the improved name in keystone only and leave this option alone. Will make that change when I respin.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":112,"context_line":"* A positive integer or 0."},{"line_number":113,"context_line":"* -1 to disable the quota."},{"line_number":114,"context_line":"\"\"\"),"},{"line_number":115,"context_line":"    cfg.IntOpt(\u0027injected_file_path_bytes\u0027,"},{"line_number":116,"context_line":"        min\u003d-1,"},{"line_number":117,"context_line":"        default\u003d255,"},{"line_number":118,"context_line":"        deprecated_opts\u003d["}],"source_content_type":"text/x-python","patch_set":14,"id":"441d5a02_ecd98ffe","line":115,"in_reply_to":"7964eab7_28a4e2ab","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"}],"nova/exception.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"55590f06ffadfb70e4e0cb113554aac46da8f91a","unresolved":true,"context_lines":[{"line_number":136,"context_line":""},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"class KeystoneConnectionFailed(NovaException):"},{"line_number":139,"context_line":"    msg_fmt \u003d _(\"Connection to keystone host failed: %(reason)s\")"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"class CinderConnectionFailed(NovaException):"}],"source_content_type":"text/x-python","patch_set":28,"id":"47f6c702_3e5084b5","line":139,"updated":"2022-02-07 15:11:28.000000000","message":"I was kinda hoping for something more meaningful to the user than just this. But I guess it\u0027s in keeping with the rest of the errors here. Trying to boot an instance and getting an error about not being able to talk to neutron probably tips them off that there\u0027s a networking problem, but just saying \"we can\u0027t talk to keystone\" is more vague. But, maybe it doesn\u0027t matter much since they can\u0027t do anything about it anyway.\n\nStill better than \"QuotaError\" :)","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3851cb681af03bcff0ae4e322111e8682542a31c","unresolved":false,"context_lines":[{"line_number":136,"context_line":""},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"class KeystoneConnectionFailed(NovaException):"},{"line_number":139,"context_line":"    msg_fmt \u003d _(\"Connection to keystone host failed: %(reason)s\")"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"class CinderConnectionFailed(NovaException):"}],"source_content_type":"text/x-python","patch_set":28,"id":"7cda30fd_af961b1c","line":139,"in_reply_to":"47f6c702_3e5084b5","updated":"2022-02-09 06:39:11.000000000","message":"Fair point that the message isn\u0027t considering the user perspective enough. I will try a better exception message.","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"}],"nova/limit/local.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"76e1fa32b847f8050b985b5abae47e10cc102840","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    INJECTED_FILES_CONTENT: \"injected_file_content_bytes\","},{"line_number":42,"context_line":"    # TODO(johngarbutt): can\u0027t we simplify the config names?"},{"line_number":43,"context_line":"    INJECTED_FILES_PATH: \"injected_file_path_length\","},{"line_number":44,"context_line":"}"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def enforce_api_limit(entity_type, count):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_ada34500","line":44,"updated":"2020-03-12 17:42:43.000000000","message":"The key-value pairs here are identical in all cases, it seems? Any reason not to use a list?","commit_id":"6d990cf60501d423ce29df121839029f6d051913"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"1328f1b6ea1c2eacaa79a0f66ebf87079218984c","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    INJECTED_FILES_CONTENT: \"injected_file_content_bytes\","},{"line_number":42,"context_line":"    # TODO(johngarbutt): can\u0027t we simplify the config names?"},{"line_number":43,"context_line":"    INJECTED_FILES_PATH: \"injected_file_path_length\","},{"line_number":44,"context_line":"}"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def enforce_api_limit(entity_type, count):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_5a8261ca","line":44,"in_reply_to":"1fa4df85_ada34500","updated":"2020-03-16 11:17:29.000000000","message":"Please note the TODO and injected_file_path_length vs injected_file_path_bytes","commit_id":"6d990cf60501d423ce29df121839029f6d051913"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e97d3cf2eea65cb2f0e58a86190097e4130301a6","unresolved":false,"context_lines":[{"line_number":24,"context_line":"# Cache to avoid repopulating ksa state"},{"line_number":25,"context_line":"PLACEMENT_CLIENT \u003d None"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"# API limits"},{"line_number":28,"context_line":"SERVER_METADATA_ITEMS \u003d \"metadata_items\""},{"line_number":29,"context_line":"INJECTED_FILES \u003d \"injected_files\""},{"line_number":30,"context_line":"INJECTED_FILES_CONTENT \u003d \"injected_file_content_bytes\""},{"line_number":31,"context_line":"INJECTED_FILES_PATH \u003d \"injected_file_path_bytes\""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# DB limits"},{"line_number":34,"context_line":"KEY_PAIRS \u003d \"key_pairs\""}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_c34984b7","line":31,"range":{"start_line":27,"start_character":0,"end_line":31,"end_character":48},"updated":"2020-03-17 00:30:04.000000000","message":"What are these for? Repeated on L38?\n\n(later) Looks like they are what to pass as entity_type for enforce_api_limit.","commit_id":"f50f5e69040e99852d8e87a2bc7ebdc69dbd12bd"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"daa8a578b4fe832f7b841aade8a79f6f7783d6a1","unresolved":false,"context_lines":[{"line_number":24,"context_line":"# Cache to avoid repopulating ksa state"},{"line_number":25,"context_line":"PLACEMENT_CLIENT \u003d None"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"# API limits"},{"line_number":28,"context_line":"SERVER_METADATA_ITEMS \u003d \"metadata_items\""},{"line_number":29,"context_line":"INJECTED_FILES \u003d \"injected_files\""},{"line_number":30,"context_line":"INJECTED_FILES_CONTENT \u003d \"injected_file_content_bytes\""},{"line_number":31,"context_line":"INJECTED_FILES_PATH \u003d \"injected_file_path_bytes\""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# DB limits"},{"line_number":34,"context_line":"KEY_PAIRS \u003d \"key_pairs\""}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_50f54bec","line":31,"range":{"start_line":27,"start_character":0,"end_line":31,"end_character":48},"in_reply_to":"1fa4df85_c34984b7","updated":"2020-03-20 09:08:25.000000000","message":"its just constants really, referes to the strings in quota file in the RESOURCES.","commit_id":"f50f5e69040e99852d8e87a2bc7ebdc69dbd12bd"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e97d3cf2eea65cb2f0e58a86190097e4130301a6","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    INJECTED_FILES_CONTENT: \"injected_file_content_bytes\","},{"line_number":42,"context_line":"    # TODO(johngarbutt): can\u0027t we simplify the config names?"},{"line_number":43,"context_line":"    INJECTED_FILES_PATH: \"injected_file_path_length\","},{"line_number":44,"context_line":"}"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def enforce_api_limit(entity_type, count):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_63ef7087","line":44,"updated":"2020-03-17 00:30:04.000000000","message":"It seems to me API_LIMITS should just be a set([SERVER_METADATA_ITEMS, INJECTED_FILES, INJECTED_FILES_CONTENT, INJECTED_FILES_PATH])\n\nDo we need a dict that is just mapping thing:thing? I guess it\u0027s just so it mirrors DB_COUNT_FUNCTION but I\u0027m not sure it needs to. Or maybe I\u0027m missing something.","commit_id":"f50f5e69040e99852d8e87a2bc7ebdc69dbd12bd"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"daa8a578b4fe832f7b841aade8a79f6f7783d6a1","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    INJECTED_FILES_CONTENT: \"injected_file_content_bytes\","},{"line_number":42,"context_line":"    # TODO(johngarbutt): can\u0027t we simplify the config names?"},{"line_number":43,"context_line":"    INJECTED_FILES_PATH: \"injected_file_path_length\","},{"line_number":44,"context_line":"}"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def enforce_api_limit(entity_type, count):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_709ac7c5","line":44,"in_reply_to":"1fa4df85_63ef7087","updated":"2020-03-20 09:08:25.000000000","message":"There is a miss match with injected_file_path_length and injected_file_path_bytes","commit_id":"f50f5e69040e99852d8e87a2bc7ebdc69dbd12bd"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"3785d13b0dff13aa66e45693efe88e412b347f59","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"bf51134e_44e616ea","updated":"2020-06-24 21:48:30.000000000","message":"can we name it configured_limits.py instead of local.py or somethings which sounds like they are still user facing limits but operated by config only.\n\nlocal.py sounds local to nove internal to me not user facing but ignore me if that is just me :)","commit_id":"72ae800be04b1f180add106636f8b3b62b0f6d78"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"0086c2349f15603da54dcae7661090411e85312f","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            quotas\u003d{entity_type: limit})"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"def _keypair_count(context, user_id):"},{"line_number":101,"context_line":"    return objects.KeyPairList.get_count_by_user(context, user_id)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"def _server_group_count(context, project_id):"},{"line_number":105,"context_line":"    raw_counts \u003d objects.InstanceGroupList.get_counts(context, project_id)"},{"line_number":106,"context_line":"    return raw_counts[\u0027project\u0027][\u0027server_groups\u0027]"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"def _server_group_members_count(context, server_group_uuid):"},{"line_number":110,"context_line":"    # NOTE(johngarbutt) we used to count members added per user"},{"line_number":111,"context_line":"    server_group \u003d objects.InstanceGroup.get_by_uuid(context,"},{"line_number":112,"context_line":"                                                     server_group_uuid)"},{"line_number":113,"context_line":"    return len(server_group.members)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"DB_COUNT_FUNCTION \u003d {"}],"source_content_type":"text/x-python","patch_set":9,"id":"bf51134e_6486babb","line":113,"range":{"start_line":100,"start_character":0,"end_line":113,"end_character":36},"updated":"2020-06-24 21:56:57.000000000","message":"all these are going to be configured based like API limit right? I did not get why we are doing DB checks for these?","commit_id":"72ae800be04b1f180add106636f8b3b62b0f6d78"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"663887f421cc9c812b4489343e349a52b3c70e66","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            quotas\u003d{entity_type: limit})"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"def _keypair_count(context, user_id):"},{"line_number":101,"context_line":"    return objects.KeyPairList.get_count_by_user(context, user_id)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"def _server_group_count(context, project_id):"},{"line_number":105,"context_line":"    raw_counts \u003d objects.InstanceGroupList.get_counts(context, project_id)"},{"line_number":106,"context_line":"    return raw_counts[\u0027project\u0027][\u0027server_groups\u0027]"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"def _server_group_members_count(context, server_group_uuid):"},{"line_number":110,"context_line":"    # NOTE(johngarbutt) we used to count members added per user"},{"line_number":111,"context_line":"    server_group \u003d objects.InstanceGroup.get_by_uuid(context,"},{"line_number":112,"context_line":"                                                     server_group_uuid)"},{"line_number":113,"context_line":"    return len(server_group.members)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"DB_COUNT_FUNCTION \u003d {"}],"source_content_type":"text/x-python","patch_set":9,"id":"bf51134e_3f404b07","line":113,"range":{"start_line":100,"start_character":0,"end_line":113,"end_character":36},"in_reply_to":"bf51134e_6486babb","updated":"2020-06-24 22:25:21.000000000","message":"ignore me, this is to count the usage.","commit_id":"72ae800be04b1f180add106636f8b3b62b0f6d78"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"3785d13b0dff13aa66e45693efe88e412b347f59","unresolved":false,"context_lines":[{"line_number":112,"context_line":"                                                     server_group_uuid)"},{"line_number":113,"context_line":"    return len(server_group.members)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"DB_COUNT_FUNCTION \u003d {"},{"line_number":117,"context_line":"    KEY_PAIRS: _keypair_count,"},{"line_number":118,"context_line":"    SERVER_GROUPS: _server_group_count,"},{"line_number":119,"context_line":"    SERVER_GROUP_MEMBERS: _server_group_members_count"},{"line_number":120,"context_line":"}"}],"source_content_type":"text/x-python","patch_set":9,"id":"bf51134e_36d078c9","line":120,"range":{"start_line":115,"start_character":0,"end_line":120,"end_character":1},"updated":"2020-06-24 21:48:30.000000000","message":"can we move this to up for easy read.","commit_id":"72ae800be04b1f180add106636f8b3b62b0f6d78"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e88d9e12683449748a55d4b161a6caa6400286eb","unresolved":true,"context_lines":[{"line_number":36,"context_line":"# Entity types for all DB limits, shares names with config options"},{"line_number":37,"context_line":"KEY_PAIRS \u003d \"key_pairs\""},{"line_number":38,"context_line":"SERVER_GROUPS \u003d \"server_groups\""},{"line_number":39,"context_line":"SERVER_GROUP_MEMBERS \u003d \"server_group_members\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":42,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":10,"id":"6706aa62_34852ad0","line":39,"updated":"2021-05-05 22:59:24.000000000","message":"Note that for now, we will count servers from the DB however they are not located here ^, but rather with the keystone limits:\n\nhttps://review.opendev.org/c/openstack/nova/+/713301/7/nova/limit/keystone.py#74\n\nWe can\u0027t yet count servers from placement because we don\u0027t have consumer types, that is, we can\u0027t assume that all resource consumers in placement are nova instances.\n\nI\u0027m working on consumer types in placement this cycle [1] and consuming the feature in nova will involve applying a consumer type to all of the existing placement consumers in an online data migration like: \"for all non-deleted instances: PUT allocations/{consumer_uuid} with consumer_type\u003dSERVER\". After that migration is guaranteed to be complete, we can assume we can count number of instances in placement going forward.\n\n[1] https://review.opendev.org/q/topic:%22bp%252Fsupport-consumer-types%22\n[2] https://docs.openstack.org/api-ref/placement/?expanded\u003dupdate-allocations-detail#update-allocations","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3851cb681af03bcff0ae4e322111e8682542a31c","unresolved":true,"context_lines":[{"line_number":36,"context_line":"# Entity types for all DB limits, shares names with config options"},{"line_number":37,"context_line":"KEY_PAIRS \u003d \"key_pairs\""},{"line_number":38,"context_line":"SERVER_GROUPS \u003d \"server_groups\""},{"line_number":39,"context_line":"SERVER_GROUP_MEMBERS \u003d \"server_group_members\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":42,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":10,"id":"367f5b05_b65265cf","line":39,"in_reply_to":"26860b90_6c510af2","updated":"2022-02-09 06:39:11.000000000","message":"Yes counting with SERVER consumer type will depend on nova being updated to specify placement microversion 1.38 and sending along a consumer type when it writes allocations. We would also ideally provide a tool for migrating existing allocations to consumer types. I was thinking that work would have its own spec.","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8d3e10c29f70d460c0e5ab132a36fc828c602b09","unresolved":true,"context_lines":[{"line_number":36,"context_line":"# Entity types for all DB limits, shares names with config options"},{"line_number":37,"context_line":"KEY_PAIRS \u003d \"key_pairs\""},{"line_number":38,"context_line":"SERVER_GROUPS \u003d \"server_groups\""},{"line_number":39,"context_line":"SERVER_GROUP_MEMBERS \u003d \"server_group_members\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":42,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":10,"id":"e112e4af_8399d062","line":39,"in_reply_to":"367f5b05_b65265cf","updated":"2022-02-09 15:24:21.000000000","message":"Agreed, let\u0027s then do it for a next release.","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7f81f7cf3d17b9b51772d10fe65cf050d4bc3e96","unresolved":true,"context_lines":[{"line_number":36,"context_line":"# Entity types for all DB limits, shares names with config options"},{"line_number":37,"context_line":"KEY_PAIRS \u003d \"key_pairs\""},{"line_number":38,"context_line":"SERVER_GROUPS \u003d \"server_groups\""},{"line_number":39,"context_line":"SERVER_GROUP_MEMBERS \u003d \"server_group_members\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":42,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":10,"id":"26860b90_6c510af2","line":39,"in_reply_to":"6706aa62_34852ad0","updated":"2022-02-08 10:35:41.000000000","message":"Thanks for the explanation. Now that consumer types are a thing, I guess we would count the placement consumers with SERVER consumer_type in another patch later ?","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"70ef56d855c0f0926618cc32795309bc0b3751fb","unresolved":false,"context_lines":[{"line_number":36,"context_line":"# Entity types for all DB limits, shares names with config options"},{"line_number":37,"context_line":"KEY_PAIRS \u003d \"key_pairs\""},{"line_number":38,"context_line":"SERVER_GROUPS \u003d \"server_groups\""},{"line_number":39,"context_line":"SERVER_GROUP_MEMBERS \u003d \"server_group_members\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":42,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":10,"id":"9331e3da_21652bc8","line":39,"in_reply_to":"e112e4af_8399d062","updated":"2022-02-09 16:21:37.000000000","message":"Ack","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"cb6d15c51e3566e7e1026979efadcee91546c1e1","unresolved":true,"context_lines":[{"line_number":42,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def enforce_api_limit(entity_type, count):"},{"line_number":46,"context_line":"    \"\"\"Check if the values given are over the limit for that key."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    This is generally used for limiting the size of certain API requests"}],"source_content_type":"text/x-python","patch_set":10,"id":"c1ee842f_c12c2443","line":45,"range":{"start_line":45,"start_character":23,"end_line":45,"end_character":40},"updated":"2021-05-10 16:43:51.000000000","message":"What\u0027s the chances of getting type hints for this new code, if you need to rework things? afaict, this would be:\n\n  def enforce_api_limit(entity_type: str, count: int) -\u003e None","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":42,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def enforce_api_limit(entity_type, count):"},{"line_number":46,"context_line":"    \"\"\"Check if the values given are over the limit for that key."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    This is generally used for limiting the size of certain API requests"}],"source_content_type":"text/x-python","patch_set":10,"id":"76fbb68c_18cf4477","line":45,"range":{"start_line":45,"start_character":23,"end_line":45,"end_character":40},"in_reply_to":"c1ee842f_c12c2443","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"cb6d15c51e3566e7e1026979efadcee91546c1e1","unresolved":true,"context_lines":[{"line_number":53,"context_line":"        return"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    if entity_type not in API_LIMITS:"},{"line_number":56,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    limit \u003d getattr(CONF.quota, entity_type)"},{"line_number":59,"context_line":"    if count \u003e limit:"}],"source_content_type":"text/x-python","patch_set":10,"id":"82f407f6_514bdfe6","line":56,"range":{"start_line":56,"start_character":26,"end_line":56,"end_character":37},"updated":"2021-05-10 16:43:51.000000000","message":"A more meaningful error message here would be helpful. Took me a while to realize this should never actually happen","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        return"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    if entity_type not in API_LIMITS:"},{"line_number":56,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    limit \u003d getattr(CONF.quota, entity_type)"},{"line_number":59,"context_line":"    if count \u003e limit:"}],"source_content_type":"text/x-python","patch_set":10,"id":"4efa1719_ce7349cb","line":56,"range":{"start_line":56,"start_character":26,"end_line":56,"end_character":37},"in_reply_to":"82f407f6_514bdfe6","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"cb6d15c51e3566e7e1026979efadcee91546c1e1","unresolved":true,"context_lines":[{"line_number":62,"context_line":"            quotas\u003d{entity_type: limit})"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def enforce_db_limit(context, entity_type, entity_scope, delta):"},{"line_number":66,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    Firstly we count the current usage given the specified scope."}],"source_content_type":"text/x-python","patch_set":10,"id":"76aea1c0_1317fdeb","line":65,"updated":"2021-05-10 16:43:51.000000000","message":"type hints would be 🤩","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            quotas\u003d{entity_type: limit})"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def enforce_db_limit(context, entity_type, entity_scope, delta):"},{"line_number":66,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    Firstly we count the current usage given the specified scope."}],"source_content_type":"text/x-python","patch_set":10,"id":"0bbdbed4_f56687f9","line":65,"in_reply_to":"76aea1c0_1317fdeb","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7fed5278cdeb0f517d6346493e79b227889c24a8","unresolved":true,"context_lines":[{"line_number":66,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    Firstly we count the current usage given the specified scope."},{"line_number":69,"context_line":"    We then add that count to the specified  delta to see if we"},{"line_number":70,"context_line":"    are over the limit for that kind of entity."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    Note previously we used to recheck these limits."}],"source_content_type":"text/x-python","patch_set":10,"id":"d689595e_ab573282","line":69,"range":{"start_line":69,"start_character":43,"end_line":69,"end_character":45},"updated":"2021-08-17 14:17:23.000000000","message":"nit: double space","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    Firstly we count the current usage given the specified scope."},{"line_number":69,"context_line":"    We then add that count to the specified  delta to see if we"},{"line_number":70,"context_line":"    are over the limit for that kind of entity."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    Note previously we used to recheck these limits."}],"source_content_type":"text/x-python","patch_set":10,"id":"df662433_a9d303a1","line":69,"range":{"start_line":69,"start_character":43,"end_line":69,"end_character":45},"in_reply_to":"d689595e_ab573282","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"cb6d15c51e3566e7e1026979efadcee91546c1e1","unresolved":true,"context_lines":[{"line_number":83,"context_line":"        return"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    if entity_type not in DB_COUNT_FUNCTION.keys():"},{"line_number":86,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":87,"context_line":"    if int(delta) \u003c 0:"},{"line_number":88,"context_line":"        raise ValueError(\"delta must be a positive integer\")"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"877cbf51_4c36cbaf","line":86,"range":{"start_line":86,"start_character":26,"end_line":86,"end_character":37},"updated":"2021-05-10 16:43:51.000000000","message":"ditto","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        return"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    if entity_type not in DB_COUNT_FUNCTION.keys():"},{"line_number":86,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":87,"context_line":"    if int(delta) \u003c 0:"},{"line_number":88,"context_line":"        raise ValueError(\"delta must be a positive integer\")"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ace7fd76_047cca0a","line":86,"range":{"start_line":86,"start_character":26,"end_line":86,"end_character":37},"in_reply_to":"877cbf51_4c36cbaf","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"cb6d15c51e3566e7e1026979efadcee91546c1e1","unresolved":true,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    if entity_type not in DB_COUNT_FUNCTION.keys():"},{"line_number":86,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":87,"context_line":"    if int(delta) \u003c 0:"},{"line_number":88,"context_line":"        raise ValueError(\"delta must be a positive integer\")"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    count_function \u003d DB_COUNT_FUNCTION[entity_type]"}],"source_content_type":"text/x-python","patch_set":10,"id":"81302dd9_5e938501","line":87,"updated":"2021-05-10 16:43:51.000000000","message":"style nit: newline before this would be nice.\n\nAlso, do we need the cast?","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    if entity_type not in DB_COUNT_FUNCTION.keys():"},{"line_number":86,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":87,"context_line":"    if int(delta) \u003c 0:"},{"line_number":88,"context_line":"        raise ValueError(\"delta must be a positive integer\")"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    count_function \u003d DB_COUNT_FUNCTION[entity_type]"}],"source_content_type":"text/x-python","patch_set":10,"id":"c1c40851_4359a53b","line":87,"in_reply_to":"81302dd9_5e938501","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"cb6d15c51e3566e7e1026979efadcee91546c1e1","unresolved":true,"context_lines":[{"line_number":87,"context_line":"    if int(delta) \u003c 0:"},{"line_number":88,"context_line":"        raise ValueError(\"delta must be a positive integer\")"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    count_function \u003d DB_COUNT_FUNCTION[entity_type]"},{"line_number":91,"context_line":"    count \u003d count_function(context, entity_scope)"},{"line_number":92,"context_line":"    limit \u003d getattr(CONF.quota, entity_type)"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"6a8590c7_768b0b27","line":90,"updated":"2021-05-10 16:43:51.000000000","message":"style nit: I didn\u0027t grok that this was defined later. It\u0027s definitely not mandatory, but perhaps those helpers could go before this function rather than after?","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    if int(delta) \u003c 0:"},{"line_number":88,"context_line":"        raise ValueError(\"delta must be a positive integer\")"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    count_function \u003d DB_COUNT_FUNCTION[entity_type]"},{"line_number":91,"context_line":"    count \u003d count_function(context, entity_scope)"},{"line_number":92,"context_line":"    limit \u003d getattr(CONF.quota, entity_type)"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"d59d0c85_1c34524b","line":90,"in_reply_to":"6a8590c7_768b0b27","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e7426e329409ffcd719de900aa2d2fa54327b26b","unresolved":true,"context_lines":[{"line_number":53,"context_line":"        return"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    if entity_type not in API_LIMITS:"},{"line_number":56,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    limit \u003d getattr(CONF.quota, entity_type)"},{"line_number":59,"context_line":"    if count \u003e limit:"}],"source_content_type":"text/x-python","patch_set":12,"id":"da8ed879_825ce338","line":56,"range":{"start_line":56,"start_character":25,"end_line":56,"end_character":38},"updated":"2021-08-17 16:50:30.000000000","message":"Presumably this needs to be entity_type not \"entity_type\" ? And also I would expect it should say something more useful than just the name of the thing we\u0027re missing...","commit_id":"3f60a538e3779beccfc4f2c7eeefb95fefc4528c"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        return"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    if entity_type not in API_LIMITS:"},{"line_number":56,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    limit \u003d getattr(CONF.quota, entity_type)"},{"line_number":59,"context_line":"    if count \u003e limit:"}],"source_content_type":"text/x-python","patch_set":12,"id":"b933bf7f_a7bf4561","line":56,"range":{"start_line":56,"start_character":25,"end_line":56,"end_character":38},"in_reply_to":"da8ed879_825ce338","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"3f60a538e3779beccfc4f2c7eeefb95fefc4528c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e7426e329409ffcd719de900aa2d2fa54327b26b","unresolved":true,"context_lines":[{"line_number":83,"context_line":"        return"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    if entity_type not in DB_COUNT_FUNCTION.keys():"},{"line_number":86,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":87,"context_line":"    if int(delta) \u003c 0:"},{"line_number":88,"context_line":"        raise ValueError(\"delta must be a positive integer\")"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"08a5e0fb_a3680e74","line":86,"range":{"start_line":86,"start_character":25,"end_line":86,"end_character":38},"updated":"2021-08-17 16:50:30.000000000","message":"Same?","commit_id":"3f60a538e3779beccfc4f2c7eeefb95fefc4528c"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        return"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    if entity_type not in DB_COUNT_FUNCTION.keys():"},{"line_number":86,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":87,"context_line":"    if int(delta) \u003c 0:"},{"line_number":88,"context_line":"        raise ValueError(\"delta must be a positive integer\")"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9097e8a4_ada2fe26","line":86,"range":{"start_line":86,"start_character":25,"end_line":86,"end_character":38},"in_reply_to":"08a5e0fb_a3680e74","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"3f60a538e3779beccfc4f2c7eeefb95fefc4528c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2738f24a7d21dc3c100ba73cf29007d47c01e3b2","unresolved":true,"context_lines":[{"line_number":57,"context_line":"        return"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    if entity_type not in API_LIMITS:"},{"line_number":60,"context_line":"        fmt \u003d \"%s is not a valid API limit: %s\""},{"line_number":61,"context_line":"        raise ValueError(fmt % (entity_type, API_LIMITS))"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"9969c621_d240499f","line":60,"updated":"2021-08-30 14:04:41.000000000","message":"So much better, IMHO.","commit_id":"12d0af9fba68f28f3024c3bd8dc1154c95892636"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        return"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    if entity_type not in API_LIMITS:"},{"line_number":60,"context_line":"        fmt \u003d \"%s is not a valid API limit: %s\""},{"line_number":61,"context_line":"        raise ValueError(fmt % (entity_type, API_LIMITS))"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"3bc97b57_ab0db1f4","line":60,"in_reply_to":"9969c621_d240499f","updated":"2022-02-02 03:36:22.000000000","message":"Ack","commit_id":"12d0af9fba68f28f3024c3bd8dc1154c95892636"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2738f24a7d21dc3c100ba73cf29007d47c01e3b2","unresolved":true,"context_lines":[{"line_number":65,"context_line":"    except limit_exception.SessionInitError as e:"},{"line_number":66,"context_line":"        raise exception.QuotaError(str(e))"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    reg_limit \u003d limit_utils._get_registered_limit(entity_type)"},{"line_number":69,"context_line":"    reg_limit \u003d reg_limit.default_limit if reg_limit else None"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    if not reg_limit or count \u003e reg_limit:"}],"source_content_type":"text/x-python","patch_set":13,"id":"f7a000b5_7a7986cd","line":68,"updated":"2021-08-30 14:04:41.000000000","message":"I really don\u0027t think it\u0027s okay to reach into the library internals for the final version of this that we land. Also, why are you even doing that? Isn\u0027t this a straight enforce operation? You just need to translate the ProjectOverLimit to OverQuota but otherwise it\u0027s just that, no?","commit_id":"12d0af9fba68f28f3024c3bd8dc1154c95892636"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"42956b57bf9d9f4db037d7ce4dccc2f30d44ea26","unresolved":true,"context_lines":[{"line_number":65,"context_line":"    except limit_exception.SessionInitError as e:"},{"line_number":66,"context_line":"        raise exception.QuotaError(str(e))"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    reg_limit \u003d limit_utils._get_registered_limit(entity_type)"},{"line_number":69,"context_line":"    reg_limit \u003d reg_limit.default_limit if reg_limit else None"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    if not reg_limit or count \u003e reg_limit:"}],"source_content_type":"text/x-python","patch_set":13,"id":"2aca36e6_a37377ab","line":68,"in_reply_to":"297f54a2_e614c00d","updated":"2021-08-30 17:35:38.000000000","message":"\u003e I did this to get only a registered limit because (1) these limits cannot be project limits because they are not enforced per project, they are global only and (2) these resources are not things that fit the enforce counting model to count per project.\n\nOkay, but we can still use the enforcer for that right? In the earlier discussion I mentioned just using a zero-length, zero-uuid, or other placeholder project_id when we do the query. I thought John at least acked that approach.\n\n\u003e I didn\u0027t think it would be better to put them into enforce when they will not actually be counted scoped to a project (the enforce callback shows that they will be counted with a project scope). I didn\u0027t think it would be OK to do something different underneath and not honor what the interface is showing. I thought it would be misleading. Reaching into the internals is ugly but it\u0027s not misleading. And I thought ugly would be preferable over misleading.\n\nWell, personally I think reaching into the internals is not reasonable at all, because we\u0027d break if the internals change. This is, IMHO, the extent of the public interface for oslo.limit:\n\nhttps://docs.openstack.org/oslo.limit/latest/reference/api/oslo_limit.limit.html\n\n\u003e Re: (1) also, enforce will prefer a project limit if one exists and we aren\u0027t allowing that for these global default limits. There is no way to prevent enforce from \"overriding\" a registered limit with a project limit if one exists. We don\u0027t want any overrides here with global-only limits. With oslo.limit enforce, if an operator did create a project limit for say \"server_metadata_items\" that limit would take precedence over the default limit and if we used that project limit, it would be incorrect/misleading in that it implies enforcement scoped to a project when that is not actually what will happen.\n\nI understand, but it\u0027s all based on the project_id you pass to it. Will keystone refuse to do the lookup if you use something that isn\u0027t a valid project_id? Either way, I think we need support in oslo.limit for this sort of thing by allowing for a None project_id to skip the project limit lookup. Just probing into the internals to skip half of the regular way it works is just asking for trouble, IMHO.\n\nI think if you want to fetch the registered limit directly, it\u0027d be better to use the client itself (i.e. what _get_registered_limit() does) instead of calling into oslo.limit internals. At least that\u0027s a stable library interface. Should be a fairly simple swap to that right?\n\n\u003e I agree that we need to add more interfaces to oslo.limit in order to do this better but oslo feature freeze was August 19, one day after we decided to change direction and put these \"API and DB\" limits into keystone. So I thought it was implied that we were not going to go for a perfect final version for the initial code landing.\n\nAck, TBH I didn\u0027t think this was likely to land in xena given how much above this hadn\u0027t seen much review until the last minute and things like this that I figured were waiting for actual interfaces.","commit_id":"12d0af9fba68f28f3024c3bd8dc1154c95892636"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"0196c06290ae12287f4719c010f62d36528d8231","unresolved":true,"context_lines":[{"line_number":65,"context_line":"    except limit_exception.SessionInitError as e:"},{"line_number":66,"context_line":"        raise exception.QuotaError(str(e))"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    reg_limit \u003d limit_utils._get_registered_limit(entity_type)"},{"line_number":69,"context_line":"    reg_limit \u003d reg_limit.default_limit if reg_limit else None"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    if not reg_limit or count \u003e reg_limit:"}],"source_content_type":"text/x-python","patch_set":13,"id":"a3606f4d_f9aa3fbf","line":68,"in_reply_to":"2aca36e6_a37377ab","updated":"2021-08-30 21:09:52.000000000","message":"OK, I may have missed the earlier discussed point about using a all-zeros project_id or similar until project_id\u003dNone is possible in oslo.limit. I will look into doing that.\n\nAnd also that is a fair point about at least using the client connection itself instead of the private method; I didn\u0027t think of doing that.\n\nAck, I had thought it had a fair chance of landing in xena because most of the set had +2s and some +Ws on it prior to the decision to use unified limits for all limits.","commit_id":"12d0af9fba68f28f3024c3bd8dc1154c95892636"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"8b0ae9ab7e669aa854d8db7a2fc01e7299ce3115","unresolved":true,"context_lines":[{"line_number":65,"context_line":"    except limit_exception.SessionInitError as e:"},{"line_number":66,"context_line":"        raise exception.QuotaError(str(e))"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    reg_limit \u003d limit_utils._get_registered_limit(entity_type)"},{"line_number":69,"context_line":"    reg_limit \u003d reg_limit.default_limit if reg_limit else None"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    if not reg_limit or count \u003e reg_limit:"}],"source_content_type":"text/x-python","patch_set":13,"id":"ae21a995_07d1f67c","line":68,"in_reply_to":"a3606f4d_f9aa3fbf","updated":"2021-08-31 14:27:20.000000000","message":"I have changed everything over to using oslo.limit public interfaces using the empty/dummy project_id approach. It seems to have turned out nicely.","commit_id":"12d0af9fba68f28f3024c3bd8dc1154c95892636"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    except limit_exception.SessionInitError as e:"},{"line_number":66,"context_line":"        raise exception.QuotaError(str(e))"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    reg_limit \u003d limit_utils._get_registered_limit(entity_type)"},{"line_number":69,"context_line":"    reg_limit \u003d reg_limit.default_limit if reg_limit else None"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    if not reg_limit or count \u003e reg_limit:"}],"source_content_type":"text/x-python","patch_set":13,"id":"43d701ab_da55a953","line":68,"in_reply_to":"ae21a995_07d1f67c","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"12d0af9fba68f28f3024c3bd8dc1154c95892636"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cf0a356e706dda83f85d0de0eafec6db6d793c11","unresolved":true,"context_lines":[{"line_number":65,"context_line":"    except limit_exception.SessionInitError as e:"},{"line_number":66,"context_line":"        raise exception.QuotaError(str(e))"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    reg_limit \u003d limit_utils._get_registered_limit(entity_type)"},{"line_number":69,"context_line":"    reg_limit \u003d reg_limit.default_limit if reg_limit else None"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    if not reg_limit or count \u003e reg_limit:"}],"source_content_type":"text/x-python","patch_set":13,"id":"297f54a2_e614c00d","line":68,"in_reply_to":"f7a000b5_7a7986cd","updated":"2021-08-30 16:11:08.000000000","message":"I did this to get only a registered limit because (1) these limits cannot be project limits because they are not enforced per project, they are global only and (2) these resources are not things that fit the enforce counting model to count per project.\n\nI didn\u0027t think it would be better to put them into enforce when they will not actually be counted scoped to a project (the enforce callback shows that they will be counted with a project scope). I didn\u0027t think it would be OK to do something different underneath and not honor what the interface is showing. I thought it would be misleading. Reaching into the internals is ugly but it\u0027s not misleading. And I thought ugly would be preferable over misleading.\n\nRe: (1) also, enforce will prefer a project limit if one exists and we aren\u0027t allowing that for these global default limits. There is no way to prevent enforce from \"overriding\" a registered limit with a project limit if one exists. We don\u0027t want any overrides here with global-only limits. With oslo.limit enforce, if an operator did create a project limit for say \"server_metadata_items\" that limit would take precedence over the default limit and if we used that project limit, it would be incorrect/misleading in that it implies enforcement scoped to a project when that is not actually what will happen.\n\nI agree that we need to add more interfaces to oslo.limit in order to do this better but oslo feature freeze was August 19, one day after we decided to change direction and put these \"API and DB\" limits into keystone. So I thought it was implied that we were not going to go for a perfect final version for the initial code landing.","commit_id":"12d0af9fba68f28f3024c3bd8dc1154c95892636"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2738f24a7d21dc3c100ba73cf29007d47c01e3b2","unresolved":true,"context_lines":[{"line_number":108,"context_line":"    count_function \u003d DB_COUNT_FUNCTION[entity_type]"},{"line_number":109,"context_line":"    count \u003d count_function(context, entity_scope)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    reg_limit \u003d limit_utils._get_registered_limit(entity_type)"},{"line_number":112,"context_line":"    reg_limit \u003d reg_limit.default_limit if reg_limit else None"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    if not reg_limit or count + int(delta) \u003e reg_limit:"},{"line_number":115,"context_line":"        raise exception.OverQuota("},{"line_number":116,"context_line":"            overs\u003d[entity_type],"},{"line_number":117,"context_line":"            quotas\u003d{entity_type: reg_limit})"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"def _keypair_count(context, user_id):"}],"source_content_type":"text/x-python","patch_set":13,"id":"6d313a3f_9a571758","line":117,"range":{"start_line":111,"start_character":1,"end_line":117,"end_character":44},"updated":"2021-08-30 14:04:41.000000000","message":"This is all duplicated from above, and is effectively the same logic as oslo.limit\u0027s enforce right? I\u0027m not sure why we\u0027re re-creating our own check here.","commit_id":"12d0af9fba68f28f3024c3bd8dc1154c95892636"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cf0a356e706dda83f85d0de0eafec6db6d793c11","unresolved":true,"context_lines":[{"line_number":108,"context_line":"    count_function \u003d DB_COUNT_FUNCTION[entity_type]"},{"line_number":109,"context_line":"    count \u003d count_function(context, entity_scope)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    reg_limit \u003d limit_utils._get_registered_limit(entity_type)"},{"line_number":112,"context_line":"    reg_limit \u003d reg_limit.default_limit if reg_limit else None"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    if not reg_limit or count + int(delta) \u003e reg_limit:"},{"line_number":115,"context_line":"        raise exception.OverQuota("},{"line_number":116,"context_line":"            overs\u003d[entity_type],"},{"line_number":117,"context_line":"            quotas\u003d{entity_type: reg_limit})"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"def _keypair_count(context, user_id):"}],"source_content_type":"text/x-python","patch_set":13,"id":"d9c204ef_ade447e9","line":117,"range":{"start_line":111,"start_character":1,"end_line":117,"end_character":44},"in_reply_to":"6d313a3f_9a571758","updated":"2021-08-30 16:11:08.000000000","message":"See my previous comment, reasoning is the same.","commit_id":"12d0af9fba68f28f3024c3bd8dc1154c95892636"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    count_function \u003d DB_COUNT_FUNCTION[entity_type]"},{"line_number":109,"context_line":"    count \u003d count_function(context, entity_scope)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    reg_limit \u003d limit_utils._get_registered_limit(entity_type)"},{"line_number":112,"context_line":"    reg_limit \u003d reg_limit.default_limit if reg_limit else None"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    if not reg_limit or count + int(delta) \u003e reg_limit:"},{"line_number":115,"context_line":"        raise exception.OverQuota("},{"line_number":116,"context_line":"            overs\u003d[entity_type],"},{"line_number":117,"context_line":"            quotas\u003d{entity_type: reg_limit})"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"def _keypair_count(context, user_id):"}],"source_content_type":"text/x-python","patch_set":13,"id":"f0e04053_5c108829","line":117,"range":{"start_line":111,"start_character":1,"end_line":117,"end_character":44},"in_reply_to":"d9c204ef_ade447e9","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"12d0af9fba68f28f3024c3bd8dc1154c95892636"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4f80fe91c45402cdee58fa5f4e81543dece154e6","unresolved":true,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# TODO(melwitt): Remove this when oslo.limit supports project_id\u003dNone for"},{"line_number":48,"context_line":"# enforce()."},{"line_number":49,"context_line":"NULL_PROJECT_ID \u003d \u002700000000-0000-0000-0000-000000000000\u0027"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":52,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":14,"id":"5cd11383_e64f01a0","line":49,"updated":"2021-08-31 18:49:34.000000000","message":"This is one thing I proposed, which seems fine to me. We know it can\u0027t be generated. The only problem would be if someone actually created a zero-uuid project limit, but I think that\u0027s an edge case, especially if we\u0027re going to support None in oslo.limit.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"90ca72b912a0d453041f77e08db34ac1a7f25889","unresolved":true,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# TODO(melwitt): Remove this when oslo.limit supports project_id\u003dNone for"},{"line_number":48,"context_line":"# enforce()."},{"line_number":49,"context_line":"NULL_PROJECT_ID \u003d \u002700000000-0000-0000-0000-000000000000\u0027"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":52,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":14,"id":"befbb5e5_240c8c41","line":49,"in_reply_to":"5cd11383_e64f01a0","updated":"2021-08-31 19:05:48.000000000","message":"Ack, I was thinking the same thing that someone could technically create a all zeros uuid for a project but it seems quite the edge case.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cb90d5695b129622a2724cbdcc4a15ac81737053","unresolved":true,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# TODO(melwitt): Remove this when oslo.limit supports project_id\u003dNone for"},{"line_number":48,"context_line":"# enforce()."},{"line_number":49,"context_line":"NULL_PROJECT_ID \u003d \u002700000000-0000-0000-0000-000000000000\u0027"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":52,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":14,"id":"e2cd01ba_b217905c","line":49,"in_reply_to":"5df436b4_27609f00","updated":"2021-08-31 22:01:23.000000000","message":"Yeah, but once we\u0027re able to land changes to o.limit I think the \"None means don\u0027t even fetch the project limit\" behavior is what we want anyway.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# TODO(melwitt): Remove this when oslo.limit supports project_id\u003dNone for"},{"line_number":48,"context_line":"# enforce()."},{"line_number":49,"context_line":"NULL_PROJECT_ID \u003d \u002700000000-0000-0000-0000-000000000000\u0027"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":52,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":14,"id":"71ba74f7_905fc2b2","line":49,"in_reply_to":"77f33f12_f66ca9e5","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"c4eab7aa691097e2d0d47a7a1b79ceb6169d2d8d","unresolved":true,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# TODO(melwitt): Remove this when oslo.limit supports project_id\u003dNone for"},{"line_number":48,"context_line":"# enforce()."},{"line_number":49,"context_line":"NULL_PROJECT_ID \u003d \u002700000000-0000-0000-0000-000000000000\u0027"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":52,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":14,"id":"c4d8194f_69f8f8bb","line":49,"in_reply_to":"befbb5e5_240c8c41","updated":"2021-08-31 21:04:51.000000000","message":"I kept thinking about the all zero uuid and how one of your other suggestions of empty string project_id would be better. I had assumed such a thing would be rejected by the keystone API but based on some local testing, it looks to be allowed. I\u0027m going to try changing to that and see what happens on the tempest run.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"59a46959f3c24b6c647e702726d17d6556836b88","unresolved":true,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# TODO(melwitt): Remove this when oslo.limit supports project_id\u003dNone for"},{"line_number":48,"context_line":"# enforce()."},{"line_number":49,"context_line":"NULL_PROJECT_ID \u003d \u002700000000-0000-0000-0000-000000000000\u0027"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":52,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":14,"id":"5df436b4_27609f00","line":49,"in_reply_to":"c4d8194f_69f8f8bb","updated":"2021-08-31 21:08:03.000000000","message":"\u003e I kept thinking about the all zero uuid and how one of your other suggestions of empty string project_id would be better. I had assumed such a thing would be rejected by the keystone API but based on some local testing, it looks to be allowed. I\u0027m going to try changing to that and see what happens on the tempest run.\n\nIn classic fashion, after I posted this I remembered that oslo.limit enforce doesn\u0027t allow an empty string for a project_id. /facepalm","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"0b09fd79af3195007fc352c7fa2fc5832d8927ea","unresolved":true,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# TODO(melwitt): Remove this when oslo.limit supports project_id\u003dNone for"},{"line_number":48,"context_line":"# enforce()."},{"line_number":49,"context_line":"NULL_PROJECT_ID \u003d \u002700000000-0000-0000-0000-000000000000\u0027"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"# Checks only happen when we are using the unified limits driver"},{"line_number":52,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""}],"source_content_type":"text/x-python","patch_set":14,"id":"77f33f12_f66ca9e5","line":49,"in_reply_to":"e2cd01ba_b217905c","updated":"2021-08-31 22:12:19.000000000","message":"Yes, of course. I had been thinking empty string would have been a nicer interim state than zero-uuid for this set.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4f80fe91c45402cdee58fa5f4e81543dece154e6","unresolved":true,"context_lines":[{"line_number":52,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def _get_usage_api(project_id, resource_names):"},{"line_number":56,"context_line":"    \"\"\"Called by oslo_limit\u0027s enforcer\"\"\""},{"line_number":57,"context_line":"    # Return usage of 0 for API limits. Values in API requests will be used as"},{"line_number":58,"context_line":"    # the deltas."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba6f53c4_a0efda23","line":55,"updated":"2021-08-31 18:49:34.000000000","message":"This is just a nit, but this might be better named something like \"always_zero_usage\" so that when you use it below, it\u0027s more clear what it will return to the enforcer.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":52,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def _get_usage_api(project_id, resource_names):"},{"line_number":56,"context_line":"    \"\"\"Called by oslo_limit\u0027s enforcer\"\"\""},{"line_number":57,"context_line":"    # Return usage of 0 for API limits. Values in API requests will be used as"},{"line_number":58,"context_line":"    # the deltas."}],"source_content_type":"text/x-python","patch_set":14,"id":"413e2c7d_d2430104","line":55,"in_reply_to":"3a192b49_a6c21e3a","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"90ca72b912a0d453041f77e08db34ac1a7f25889","unresolved":true,"context_lines":[{"line_number":52,"context_line":"UNIFIED_LIMITS_DRIVER \u003d \"nova.quota.UnifiedLimitsDriver\""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def _get_usage_api(project_id, resource_names):"},{"line_number":56,"context_line":"    \"\"\"Called by oslo_limit\u0027s enforcer\"\"\""},{"line_number":57,"context_line":"    # Return usage of 0 for API limits. Values in API requests will be used as"},{"line_number":58,"context_line":"    # the deltas."}],"source_content_type":"text/x-python","patch_set":14,"id":"3a192b49_a6c21e3a","line":55,"in_reply_to":"ba6f53c4_a0efda23","updated":"2021-08-31 19:05:48.000000000","message":"Agree that\u0027s a better name. I\u0027ll change it when I respin.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4f80fe91c45402cdee58fa5f4e81543dece154e6","unresolved":true,"context_lines":[{"line_number":66,"context_line":"    that eventually get stored in the database."},{"line_number":67,"context_line":"    \"\"\""},{"line_number":68,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":69,"context_line":"        LOG.debug(\"Skip unified limits checks.\")"},{"line_number":70,"context_line":"        return"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    if entity_type not in API_LIMITS:"}],"source_content_type":"text/x-python","patch_set":14,"id":"e9fcfc23_cf5e610a","line":69,"updated":"2021-08-31 18:49:34.000000000","message":"This will end up logging multiple times per request for anyone not using this yet. Nice to have for validation during development, but probably too verbose to actually land.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"85674b0f7b9d105830079feb9c13c3d3cd58429c","unresolved":true,"context_lines":[{"line_number":66,"context_line":"    that eventually get stored in the database."},{"line_number":67,"context_line":"    \"\"\""},{"line_number":68,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":69,"context_line":"        LOG.debug(\"Skip unified limits checks.\")"},{"line_number":70,"context_line":"        return"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    if entity_type not in API_LIMITS:"}],"source_content_type":"text/x-python","patch_set":14,"id":"26e2579a_a0d0d5ba","line":69,"in_reply_to":"126d452d_dc939310","updated":"2021-08-31 20:40:46.000000000","message":"Yeah I think it\u0027s likely leftover debug and not really needed ever, personally.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    that eventually get stored in the database."},{"line_number":67,"context_line":"    \"\"\""},{"line_number":68,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":69,"context_line":"        LOG.debug(\"Skip unified limits checks.\")"},{"line_number":70,"context_line":"        return"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    if entity_type not in API_LIMITS:"}],"source_content_type":"text/x-python","patch_set":14,"id":"1729c768_8a2ae278","line":69,"in_reply_to":"26e2579a_a0d0d5ba","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    that eventually get stored in the database."},{"line_number":67,"context_line":"    \"\"\""},{"line_number":68,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":69,"context_line":"        LOG.debug(\"Skip unified limits checks.\")"},{"line_number":70,"context_line":"        return"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    if entity_type not in API_LIMITS:"}],"source_content_type":"text/x-python","patch_set":14,"id":"a9a3eb33_5ae3180a","line":69,"in_reply_to":"26e2579a_a0d0d5ba","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"90ca72b912a0d453041f77e08db34ac1a7f25889","unresolved":true,"context_lines":[{"line_number":66,"context_line":"    that eventually get stored in the database."},{"line_number":67,"context_line":"    \"\"\""},{"line_number":68,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":69,"context_line":"        LOG.debug(\"Skip unified limits checks.\")"},{"line_number":70,"context_line":"        return"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    if entity_type not in API_LIMITS:"}],"source_content_type":"text/x-python","patch_set":14,"id":"126d452d_dc939310","line":69,"in_reply_to":"e9fcfc23_cf5e610a","updated":"2021-08-31 19:05:48.000000000","message":"Good point, I think we might have a \"log once\" tool around here somewhere. Alternatively, I\u0027m not sure whether we need to ever report which type of checks are being used or skipped based on quota driver (is it self-explanatory?).","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4f80fe91c45402cdee58fa5f4e81543dece154e6","unresolved":true,"context_lines":[{"line_number":89,"context_line":"            message\u003dstr(e).replace(NULL_PROJECT_ID, \u0027None\u0027))"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def enforce_db_limit(context, entity_type, entity_scope, delta):"},{"line_number":93,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    Firstly we count the current usage given the specified scope."}],"source_content_type":"text/x-python","patch_set":14,"id":"6436860f_fe9eb291","line":92,"updated":"2021-08-31 18:49:34.000000000","message":"I need to go further up the stack to see how this is used I guess, but the enforcer is optimized for checking multiple things in a single go, so it seems weird to wrap it in a single-shot interface. I would think it\u0027d be better if we could do all these local checks in a single call. It also seems weird to take this scope argument, which I think is just the key by which we\u0027re doing each query. That means the caller needs to know that for each entity type, it needs to pass a different value in this anonymous variable. Is there some reason not to just call this once, with user_id, project_id, and server_group_uuid? Why not just let it pass in the deltas so we can do the one-shot thing anyway?","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"85674b0f7b9d105830079feb9c13c3d3cd58429c","unresolved":true,"context_lines":[{"line_number":89,"context_line":"            message\u003dstr(e).replace(NULL_PROJECT_ID, \u0027None\u0027))"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def enforce_db_limit(context, entity_type, entity_scope, delta):"},{"line_number":93,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    Firstly we count the current usage given the specified scope."}],"source_content_type":"text/x-python","patch_set":14,"id":"d8dd26e4_f4eced88","line":92,"in_reply_to":"11058330_710588f3","updated":"2021-08-31 20:40:46.000000000","message":"Ah, right, okay you\u0027re right. I was thinking all about boot and not about what these resources actually are. Makes sense.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"90ca72b912a0d453041f77e08db34ac1a7f25889","unresolved":true,"context_lines":[{"line_number":89,"context_line":"            message\u003dstr(e).replace(NULL_PROJECT_ID, \u0027None\u0027))"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def enforce_db_limit(context, entity_type, entity_scope, delta):"},{"line_number":93,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    Firstly we count the current usage given the specified scope."}],"source_content_type":"text/x-python","patch_set":14,"id":"11058330_710588f3","line":92,"in_reply_to":"6436860f_fe9eb291","updated":"2021-08-31 19:05:48.000000000","message":"I *think* this is done this way because we don\u0027t ever enforce these resources (key_pairs, server_groups, server_group_members) at the same time. Key pair creates come through the POST /os-keypairs API, server group creates come through the POST /os-server-groups API, and server group member additions come through the POST /servers API.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            message\u003dstr(e).replace(NULL_PROJECT_ID, \u0027None\u0027))"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def enforce_db_limit(context, entity_type, entity_scope, delta):"},{"line_number":93,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    Firstly we count the current usage given the specified scope."}],"source_content_type":"text/x-python","patch_set":14,"id":"7a287647_02d52e4e","line":92,"in_reply_to":"d8dd26e4_f4eced88","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"de083b7f939037a58bb8b52ac696c58a045871ad","unresolved":true,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 StackHPC"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":25,"id":"e6447694_61c5a474","line":1,"updated":"2022-01-10 06:05:49.000000000","message":"nit: 2022","commit_id":"6a5dd4de7ce0dd7476d7ec5afcc411b14dc68e38"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 StackHPC"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":25,"id":"9083ea87_bb024625","line":1,"in_reply_to":"e6447694_61c5a474","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"6a5dd4de7ce0dd7476d7ec5afcc411b14dc68e38"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7f81f7cf3d17b9b51772d10fe65cf050d4bc3e96","unresolved":true,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"def _server_group_count(context, project_id, *args):"},{"line_number":59,"context_line":"    raw_counts \u003d objects.InstanceGroupList.get_counts(context, project_id)"},{"line_number":60,"context_line":"    return {\u0027server_groups\u0027: raw_counts[\u0027project\u0027][\u0027server_groups\u0027]}"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"def _server_group_members_count(context, server_group_uuid, *args):"}],"source_content_type":"text/x-python","patch_set":28,"id":"5899e7b5_d9841f91","line":60,"updated":"2022-02-08 10:35:41.000000000","message":"note for reviewers : get_counts() always returns a dict with \u0027project\u0027 key even if project has no server groups.\n\nhttps://github.com/openstack/nova/blob/43b253c/nova/objects/instance_group.py#L553","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"80d74d13cf07046698a70a973f406997ab9f6ac2","unresolved":true,"context_lines":[{"line_number":88,"context_line":"    \"\"\"Check if the values given are over the limit for that key."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    This is generally used for limiting the size of certain API requests"},{"line_number":91,"context_line":"    that eventually get stored in the database."},{"line_number":92,"context_line":"    \"\"\""},{"line_number":93,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":94,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":28,"id":"fb96c6da_a76eaf83","line":91,"updated":"2022-02-02 13:48:22.000000000","message":"So it wants to limit the size of an individual API request we don\u0027t need to track any usages (hence the always_zero_usage callback), we only check that the current size (\u003d\u003d the delta) is under the limit.","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"c3b02413f18cc2d6c35d82efc4a79103deb99011","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    \"\"\"Check if the values given are over the limit for that key."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    This is generally used for limiting the size of certain API requests"},{"line_number":91,"context_line":"    that eventually get stored in the database."},{"line_number":92,"context_line":"    \"\"\""},{"line_number":93,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":94,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":28,"id":"eb1ec022_194b5fa6","line":91,"in_reply_to":"2005b241_9de1fec9","updated":"2022-02-15 22:02:50.000000000","message":"Spec amendment is proposed here:\n\nhttps://review.opendev.org/c/openstack/nova-specs/+/829413","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3851cb681af03bcff0ae4e322111e8682542a31c","unresolved":true,"context_lines":[{"line_number":88,"context_line":"    \"\"\"Check if the values given are over the limit for that key."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    This is generally used for limiting the size of certain API requests"},{"line_number":91,"context_line":"    that eventually get stored in the database."},{"line_number":92,"context_line":"    \"\"\""},{"line_number":93,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":94,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":28,"id":"c77dec3d_a1f0318e","line":91,"in_reply_to":"9b74b635_3edaf7da","updated":"2022-02-09 06:39:11.000000000","message":"Yes, this is an artifact of making legacy \"API limits\" fit into the oslo.limit enforcement model (to avoid having two different ways of enforcing limits, one using oslo.limit and one that does not).\n\nI will upload an amendment patch for the spec to explain this.","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8d3e10c29f70d460c0e5ab132a36fc828c602b09","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    \"\"\"Check if the values given are over the limit for that key."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    This is generally used for limiting the size of certain API requests"},{"line_number":91,"context_line":"    that eventually get stored in the database."},{"line_number":92,"context_line":"    \"\"\""},{"line_number":93,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":94,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":28,"id":"2005b241_9de1fec9","line":91,"in_reply_to":"c77dec3d_a1f0318e","updated":"2022-02-09 15:24:21.000000000","message":"Thanks Melanie !","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7f81f7cf3d17b9b51772d10fe65cf050d4bc3e96","unresolved":true,"context_lines":[{"line_number":88,"context_line":"    \"\"\"Check if the values given are over the limit for that key."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    This is generally used for limiting the size of certain API requests"},{"line_number":91,"context_line":"    that eventually get stored in the database."},{"line_number":92,"context_line":"    \"\"\""},{"line_number":93,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":94,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":28,"id":"9b74b635_3edaf7da","line":91,"in_reply_to":"fb96c6da_a76eaf83","updated":"2022-02-08 10:35:41.000000000","message":"I wish we could amend the spec to reflect this design decision, which I agree but which I don\u0027t see reflected in the spec.\n\nYes, this makes sens to not track the existing usage and assume 0, but yet we should document it correctly.","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7f81f7cf3d17b9b51772d10fe65cf050d4bc3e96","unresolved":true,"context_lines":[{"line_number":91,"context_line":"    that eventually get stored in the database."},{"line_number":92,"context_line":"    \"\"\""},{"line_number":93,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":94,"context_line":"        return"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    if entity_type not in API_LIMITS:"},{"line_number":97,"context_line":"        fmt \u003d \"%s is not a valid API limit: %s\""}],"source_content_type":"text/x-python","patch_set":28,"id":"aae4d18d_243a1736","line":94,"updated":"2022-02-08 10:35:41.000000000","message":"shall we log something instead of blindly saying nothing ?\n\n(later) oh, better for verbosity is to do nothing.","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3851cb681af03bcff0ae4e322111e8682542a31c","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    that eventually get stored in the database."},{"line_number":92,"context_line":"    \"\"\""},{"line_number":93,"context_line":"    if CONF.quota.driver !\u003d UNIFIED_LIMITS_DRIVER:"},{"line_number":94,"context_line":"        return"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    if entity_type not in API_LIMITS:"},{"line_number":97,"context_line":"        fmt \u003d \"%s is not a valid API limit: %s\""}],"source_content_type":"text/x-python","patch_set":28,"id":"7d68ad60_2527a58f","line":94,"in_reply_to":"aae4d18d_243a1736","updated":"2022-02-09 06:39:11.000000000","message":"Ack","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7f81f7cf3d17b9b51772d10fe65cf050d4bc3e96","unresolved":true,"context_lines":[{"line_number":100,"context_line":"    try:"},{"line_number":101,"context_line":"        enforcer \u003d limit.Enforcer(always_zero_usage)"},{"line_number":102,"context_line":"    except limit_exceptions.SessionInitError as e:"},{"line_number":103,"context_line":"        raise exception.KeystoneConnectionFailed(reason\u003dstr(e))"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    try:"},{"line_number":106,"context_line":"        enforcer.enforce(None, {entity_type: count})"}],"source_content_type":"text/x-python","patch_set":28,"id":"fa450904_88c64e84","line":103,"updated":"2022-02-08 10:35:41.000000000","message":"this is a bit of an assumption that the Enforcer failed because there was a keystone connection issue, but OK.","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7ab9819189d34e66b470d91f0964e58695dcc225","unresolved":true,"context_lines":[{"line_number":100,"context_line":"    try:"},{"line_number":101,"context_line":"        enforcer \u003d limit.Enforcer(always_zero_usage)"},{"line_number":102,"context_line":"    except limit_exceptions.SessionInitError as e:"},{"line_number":103,"context_line":"        raise exception.KeystoneConnectionFailed(reason\u003dstr(e))"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    try:"},{"line_number":106,"context_line":"        enforcer.enforce(None, {entity_type: count})"}],"source_content_type":"text/x-python","patch_set":28,"id":"fcf09b3c_5fb685c8","line":103,"in_reply_to":"fa450904_88c64e84","updated":"2022-02-08 15:08:56.000000000","message":"SessionInitError in oslo.limit *means* the keystone session, so I think It\u0027s appropriate :)","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8d3e10c29f70d460c0e5ab132a36fc828c602b09","unresolved":true,"context_lines":[{"line_number":90,"context_line":"    except limit_exceptions.SessionInitError as e:"},{"line_number":91,"context_line":"        msg \u003d (\"Failed to connect to keystone while enforcing %s quota limit.\""},{"line_number":92,"context_line":"               % entity_type)"},{"line_number":93,"context_line":"        LOG.error(msg + \" Error: \" + str(e))"},{"line_number":94,"context_line":"        raise exception.KeystoneConnectionFailed(msg)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":30,"id":"f47f992c_228a608c","line":93,"updated":"2022-02-09 15:24:21.000000000","message":"Appreciate the further information.","commit_id":"3a16ec4b3fb121b6614dd6405a49bade24f5044d"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5957a2ef9f137c655ef48caefb644cc4d68223e9","unresolved":false,"context_lines":[{"line_number":110,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    Firstly we count the current usage given the specified scope."},{"line_number":113,"context_line":"    We then add that count to the specified  delta to see if we"},{"line_number":114,"context_line":"    are over the limit for that kind of entity."},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    Note previously we used to recheck these limits."}],"source_content_type":"text/x-python","patch_set":31,"id":"be4dd5b4_8f582932","line":113,"range":{"start_line":113,"start_character":43,"end_line":113,"end_character":45},"updated":"2022-02-10 11:11:58.000000000","message":"nit: double space","commit_id":"8327d8260495669b411273ab41a6fbd260fb7479"}],"nova/tests/unit/limit/test_local.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ca2b5d51ccc123f883b5d3934f5ca771203f2b2b","unresolved":true,"context_lines":[{"line_number":104,"context_line":"    def test_enforce_db_limit_skip(self):"},{"line_number":105,"context_line":"        self.flags(driver\u003d\"nova.quota.NoopQuotaDriver\", group\u003d\"quota\")"},{"line_number":106,"context_line":"        local_limit.enforce_db_limit(self.context, local_limit.KEY_PAIRS,"},{"line_number":107,"context_line":"                                     uuids.user_id, 1)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def test_enforce_db_limit_raise_on_invalid(self):"},{"line_number":110,"context_line":"        e \u003d self.assertRaises(ValueError, local_limit.enforce_db_limit,"}],"source_content_type":"text/x-python","patch_set":10,"id":"b3f06ef4_97264f72","line":107,"updated":"2021-05-05 02:44:05.000000000","message":"So this asserts the skip by the fact that this is a NoDBTestCase and if KeyPairList.get_count_by_user had been called, it would have raised an exception for accessing the DB. Took me a few minutes to get this :P","commit_id":"134fe4c6f0ee606b99602e09327f73333ee7a0ea"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4f80fe91c45402cdee58fa5f4e81543dece154e6","unresolved":true,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def test_enforce_api_limit_metadata(self):"},{"line_number":38,"context_line":"        # default max is 128"},{"line_number":39,"context_line":"        self.useFixture(limit_fixture.LimitFixture("},{"line_number":40,"context_line":"            {local_limit.SERVER_METADATA_ITEMS: 128}, {}))"},{"line_number":41,"context_line":"        local_limit.enforce_api_limit(local_limit.SERVER_METADATA_ITEMS, 128)"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"7ea4071b_0f9bab40","line":39,"range":{"start_line":39,"start_character":24,"end_line":39,"end_character":50},"updated":"2021-08-31 18:49:34.000000000","message":"Oh sweet! I haven\u0027t gone back to convert glance to use the fixture I wrote...so I could convert glance :)","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def test_enforce_api_limit_metadata(self):"},{"line_number":38,"context_line":"        # default max is 128"},{"line_number":39,"context_line":"        self.useFixture(limit_fixture.LimitFixture("},{"line_number":40,"context_line":"            {local_limit.SERVER_METADATA_ITEMS: 128}, {}))"},{"line_number":41,"context_line":"        local_limit.enforce_api_limit(local_limit.SERVER_METADATA_ITEMS, 128)"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"b7e267ab_cbd874a2","line":39,"range":{"start_line":39,"start_character":24,"end_line":39,"end_character":50},"in_reply_to":"5fbaf1cf_7fab833c","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"90ca72b912a0d453041f77e08db34ac1a7f25889","unresolved":true,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def test_enforce_api_limit_metadata(self):"},{"line_number":38,"context_line":"        # default max is 128"},{"line_number":39,"context_line":"        self.useFixture(limit_fixture.LimitFixture("},{"line_number":40,"context_line":"            {local_limit.SERVER_METADATA_ITEMS: 128}, {}))"},{"line_number":41,"context_line":"        local_limit.enforce_api_limit(local_limit.SERVER_METADATA_ITEMS, 128)"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"5fbaf1cf_7fab833c","line":39,"range":{"start_line":39,"start_character":24,"end_line":39,"end_character":50},"in_reply_to":"7ea4071b_0f9bab40","updated":"2021-08-31 19:05:48.000000000","message":"Yes, I give this fixture two thumbs up.","commit_id":"fd024e83585c48f668c57c42b7a1f62e379ec1ed"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2619e759a5b6eb49fd954cb7517c1da7532ecc2f","unresolved":true,"context_lines":[{"line_number":58,"context_line":"        e \u003d self.assertRaises(exception.QuotaError,"},{"line_number":59,"context_line":"                              local_limit.enforce_api_limit,"},{"line_number":60,"context_line":"                              local_limit.SERVER_METADATA_ITEMS, 42)"},{"line_number":61,"context_line":"        self.assertEqual(str(mock_util.side_effect), str(e))"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def test_enforce_api_limit_raises_for_invalid_entity(self):"},{"line_number":64,"context_line":"        e \u003d self.assertRaises(ValueError,"}],"source_content_type":"text/x-python","patch_set":27,"id":"005070c3_60639e10","line":61,"updated":"2022-01-31 18:01:44.000000000","message":"I haven\u0027t traced this all through the API, but I\u0027m gathering we\u0027re asserting here that \"any exception raised during session init is wrapped in SessionInitError, which we transparently wrap in QuotaError and raise untouched to our caller.\" I wonder though, does that end up with some nova user who is innocently trying to do something seeing something like \"keystoneauth session init error blah blah connection refused calling to controller17\" ?\n\nPoint being, they really need some sort of \"Sorry I can\u0027t do that right now\" error, but might end up with \"QuotaError\" or \"500 something broke.\"\n\nOr does QuotaError get turned into something useful regardless of what it wraps?","commit_id":"d15e72ca42e96c8de14712ea90a33bbb9a33367f"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        e \u003d self.assertRaises(exception.QuotaError,"},{"line_number":59,"context_line":"                              local_limit.enforce_api_limit,"},{"line_number":60,"context_line":"                              local_limit.SERVER_METADATA_ITEMS, 42)"},{"line_number":61,"context_line":"        self.assertEqual(str(mock_util.side_effect), str(e))"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def test_enforce_api_limit_raises_for_invalid_entity(self):"},{"line_number":64,"context_line":"        e \u003d self.assertRaises(ValueError,"}],"source_content_type":"text/x-python","patch_set":27,"id":"780bac94_8375fac7","line":61,"in_reply_to":"005070c3_60639e10","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"d15e72ca42e96c8de14712ea90a33bbb9a33367f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2619e759a5b6eb49fd954cb7517c1da7532ecc2f","unresolved":true,"context_lines":[{"line_number":142,"context_line":"        e \u003d self.assertRaises(exception.QuotaError,"},{"line_number":143,"context_line":"                              local_limit.enforce_db_limit, self.context,"},{"line_number":144,"context_line":"                              local_limit.KEY_PAIRS, uuids.user_id, 42)"},{"line_number":145,"context_line":"        self.assertEqual(str(mock_util.side_effect), str(e))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def test_enforce_db_limit_raise_on_invalid(self):"},{"line_number":148,"context_line":"        e \u003d self.assertRaises(ValueError, local_limit.enforce_db_limit,"}],"source_content_type":"text/x-python","patch_set":27,"id":"9811111a_8506054b","line":145,"updated":"2022-01-31 18:01:44.000000000","message":"Mirror my concern here, along with the appropriate fix or dismissal :)","commit_id":"d15e72ca42e96c8de14712ea90a33bbb9a33367f"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6e97ccbdcf134d9e1442ed0dc79a13e06da78a37","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        e \u003d self.assertRaises(exception.QuotaError,"},{"line_number":143,"context_line":"                              local_limit.enforce_db_limit, self.context,"},{"line_number":144,"context_line":"                              local_limit.KEY_PAIRS, uuids.user_id, 42)"},{"line_number":145,"context_line":"        self.assertEqual(str(mock_util.side_effect), str(e))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def test_enforce_db_limit_raise_on_invalid(self):"},{"line_number":148,"context_line":"        e \u003d self.assertRaises(ValueError, local_limit.enforce_db_limit,"}],"source_content_type":"text/x-python","patch_set":27,"id":"621bd6c7_f991179a","line":145,"in_reply_to":"9811111a_8506054b","updated":"2022-02-02 03:36:22.000000000","message":"Done","commit_id":"d15e72ca42e96c8de14712ea90a33bbb9a33367f"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7f81f7cf3d17b9b51772d10fe65cf050d4bc3e96","unresolved":true,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def test_enforce_api_limit_skip(self):"},{"line_number":50,"context_line":"        self.flags(driver\u003d\"nova.quota.NoopQuotaDriver\", group\u003d\"quota\")"},{"line_number":51,"context_line":"        local_limit.enforce_api_limit(local_limit.SERVER_METADATA_ITEMS, 200)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    @mock.patch(\u0027oslo_limit.limit.Enforcer\u0027)"},{"line_number":54,"context_line":"    def test_enforce_api_limit_session_init_error(self, mock_util):"}],"source_content_type":"text/x-python","patch_set":28,"id":"b89ff9ba_68ed97bf","line":51,"updated":"2022-02-08 10:35:41.000000000","message":"actually, this is probably better we don\u0027t log on purpose any DEBUG line every time we check again a NoopQuotaDriver.","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3851cb681af03bcff0ae4e322111e8682542a31c","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def test_enforce_api_limit_skip(self):"},{"line_number":50,"context_line":"        self.flags(driver\u003d\"nova.quota.NoopQuotaDriver\", group\u003d\"quota\")"},{"line_number":51,"context_line":"        local_limit.enforce_api_limit(local_limit.SERVER_METADATA_ITEMS, 200)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    @mock.patch(\u0027oslo_limit.limit.Enforcer\u0027)"},{"line_number":54,"context_line":"    def test_enforce_api_limit_session_init_error(self, mock_util):"}],"source_content_type":"text/x-python","patch_set":28,"id":"893ddd76_1d6eb591","line":51,"in_reply_to":"b89ff9ba_68ed97bf","updated":"2022-02-09 06:39:11.000000000","message":"Ack","commit_id":"91cba49c63a529aecb5bce880e4aa1374682beba"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8d3e10c29f70d460c0e5ab132a36fc828c602b09","unresolved":true,"context_lines":[{"line_number":142,"context_line":"        e \u003d self.assertRaises(exception.KeystoneConnectionFailed,"},{"line_number":143,"context_line":"                              local_limit.enforce_db_limit, self.context,"},{"line_number":144,"context_line":"                              local_limit.KEY_PAIRS, uuids.user_id, 42)"},{"line_number":145,"context_line":"        self.assertIn(str(mock_util.side_effect), str(e))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def test_enforce_db_limit_raise_on_invalid(self):"},{"line_number":148,"context_line":"        e \u003d self.assertRaises(ValueError, local_limit.enforce_db_limit,"}],"source_content_type":"text/x-python","patch_set":30,"id":"0a22aa45_599f315f","line":145,"updated":"2022-02-09 15:24:21.000000000","message":"this is no longer true","commit_id":"3a16ec4b3fb121b6614dd6405a49bade24f5044d"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"70ef56d855c0f0926618cc32795309bc0b3751fb","unresolved":true,"context_lines":[{"line_number":142,"context_line":"        e \u003d self.assertRaises(exception.KeystoneConnectionFailed,"},{"line_number":143,"context_line":"                              local_limit.enforce_db_limit, self.context,"},{"line_number":144,"context_line":"                              local_limit.KEY_PAIRS, uuids.user_id, 42)"},{"line_number":145,"context_line":"        self.assertIn(str(mock_util.side_effect), str(e))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def test_enforce_db_limit_raise_on_invalid(self):"},{"line_number":148,"context_line":"        e \u003d self.assertRaises(ValueError, local_limit.enforce_db_limit,"}],"source_content_type":"text/x-python","patch_set":30,"id":"9864fff8_6b71b2ef","line":145,"in_reply_to":"0a22aa45_599f315f","updated":"2022-02-09 16:21:37.000000000","message":"I messed up the rebase and put the change in the next patch by mistake. I will fix it now.","commit_id":"3a16ec4b3fb121b6614dd6405a49bade24f5044d"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"c3b02413f18cc2d6c35d82efc4a79103deb99011","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        e \u003d self.assertRaises(exception.KeystoneConnectionFailed,"},{"line_number":143,"context_line":"                              local_limit.enforce_db_limit, self.context,"},{"line_number":144,"context_line":"                              local_limit.KEY_PAIRS, uuids.user_id, 42)"},{"line_number":145,"context_line":"        self.assertIn(str(mock_util.side_effect), str(e))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def test_enforce_db_limit_raise_on_invalid(self):"},{"line_number":148,"context_line":"        e \u003d self.assertRaises(ValueError, local_limit.enforce_db_limit,"}],"source_content_type":"text/x-python","patch_set":30,"id":"99f845e6_99064477","line":145,"in_reply_to":"9864fff8_6b71b2ef","updated":"2022-02-15 22:02:50.000000000","message":"Done","commit_id":"3a16ec4b3fb121b6614dd6405a49bade24f5044d"}]}
