)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"04615fac07935cb393c05df9d4bcc11471efbff6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":29,"id":"4b678f4a_0c527a59","updated":"2021-11-12 19:17:16.000000000","message":"recheck bug 1912845","commit_id":"14dec8913f3e0e3847870bb642dc44770e1034c1"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b160d8080ddb65c42323bbcdcc1926e5c3763d81","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":30,"id":"61832f82_59f7e05b","updated":"2021-12-08 00:34:31.000000000","message":"recheck tempest.exceptions.SnapshotNotFoundException: Server snapshot image 6833443a-c7b9-4976-9084-907231786d74 not found.","commit_id":"69b57dd3b2a1556ae8a7cae9a9021c163c32d4c9"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5e588321fc18324d0ed465782cf2aa01af1be754","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":31,"id":"b4d52a52_f1f643a4","updated":"2022-01-21 19:52:57.000000000","message":"recheck bug 1957941","commit_id":"01dccb26d5f825bc99810a2a7eb3aa7c90558eab"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"8837a15c965d5911828087be73dc6e3205e9c080","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":31,"id":"bab5903f_78a87a66","updated":"2022-01-21 01:08:15.000000000","message":"recheck dep updated","commit_id":"01dccb26d5f825bc99810a2a7eb3aa7c90558eab"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cf9ddda862d99b48e0ab4c03f332457d213788ef","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":32,"id":"87539ea9_59ec1203","updated":"2022-01-27 21:42:01.000000000","message":"recheck bug 1944779","commit_id":"4568872e2125a0ef2baefe40be8671f4861946da"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"327f84b2e2c1bc8ef4e2abd517877c037a097c07","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":33,"id":"9db8eea3_c78f90d0","updated":"2022-02-02 16:33:41.000000000","message":"recheck nova-next has been fixed\n\nI have a question inline, -1 for visibility","commit_id":"574632f509aab5e6c157bfaae6d34bcc49cfedab"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"61db256995f8fc55997da40b220d123896762491","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":36,"id":"e86efadd_aa903d80","updated":"2022-02-10 10:46:55.000000000","message":"my question was answered so I\u0027m upgrading my vote ","commit_id":"25084e5579dbaccb54cf7ba2b66d6d32e02b7140"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"0d64e92919e08a1d56c345b5f8ff0eabbb28a42d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":38,"id":"4e391192_f6d3bca8","updated":"2022-02-25 12:53:30.000000000","message":"recheck","commit_id":"d80d253cf90843d6721f71d31f1a24e68674e99a"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"ee42ef1aff95a22d29465c6cdb2e33f1e7177f04","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":38,"id":"628678a8_9ea982b9","updated":"2022-02-26 09:21:37.000000000","message":"recheck","commit_id":"d80d253cf90843d6721f71d31f1a24e68674e99a"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"606f6fa19f3ac4182467ec5f23cf45193c561b2e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":38,"id":"854d0dd8_037aeefa","updated":"2022-02-26 18:44:24.000000000","message":"recheck","commit_id":"d80d253cf90843d6721f71d31f1a24e68674e99a"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"088c71f8e8155725192d706c22a707f37ea2c8b7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":38,"id":"9ebf1f0c_f1ff1a4e","updated":"2022-02-24 22:07:42.000000000","message":"recheck","commit_id":"d80d253cf90843d6721f71d31f1a24e68674e99a"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"bdbf4e6c280b94c4e914a0ffcd11ec29c74a308c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":38,"id":"9a557030_c4d0200f","updated":"2022-02-27 00:14:30.000000000","message":"recheck test_anti_affinity_group","commit_id":"d80d253cf90843d6721f71d31f1a24e68674e99a"}],"nova/limit/keystone.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"52946d3001a823eca2d43e8f2d7a3c37ca3047e2","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from oslo_log import log as logging"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from nova import exception"},{"line_number":22,"context_line":"from nova.limit import utils as limit_utils"},{"line_number":23,"context_line":"from nova import objects"},{"line_number":24,"context_line":"from nova import quota"},{"line_number":25,"context_line":"from nova.scheduler.client import report"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_856a227e","line":22,"updated":"2020-04-08 23:06:44.000000000","message":"This import is being eclipsed on L183 and it confused the heck out of me. xD","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"bcf08bc5c569b6b291d338714e8417284ef2b699","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from oslo_log import log as logging"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from nova import exception"},{"line_number":22,"context_line":"from nova.limit import utils as limit_utils"},{"line_number":23,"context_line":"from nova import objects"},{"line_number":24,"context_line":"from nova import quota"},{"line_number":25,"context_line":"from nova.scheduler.client import report"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_0561e4a9","line":22,"in_reply_to":"df33271e_856a227e","updated":"2021-06-07 13:19:46.000000000","message":"oh, ouch, yeah. I need some more names here.","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7d691c4a31c32f3cf777a5bc4a448dc6c383b13e","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"_ENFORCER \u003d None"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LEGACY_LIMITS \u003d {"},{"line_number":36,"context_line":"    \"servers\": \"instances\","},{"line_number":37,"context_line":"    \"class:VCPU\": \"cores\","},{"line_number":38,"context_line":"    \"class:MEMORY_MB\": \"ram\","}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_78f369e8","line":35,"updated":"2020-04-08 03:06:02.000000000","message":"Not requesting a change, but it took me a few seconds of skimming this file before I realized that this is mapping unified limit resources to legacy resource. Not sure what better name without making the name long enough to cause line wrapping annoyances.","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"52946d3001a823eca2d43e8f2d7a3c37ca3047e2","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"_ENFORCER \u003d None"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LEGACY_LIMITS \u003d {"},{"line_number":36,"context_line":"    \"servers\": \"instances\","},{"line_number":37,"context_line":"    \"class:VCPU\": \"cores\","},{"line_number":38,"context_line":"    \"class:MEMORY_MB\": \"ram\","}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_c58a6a19","line":35,"in_reply_to":"df33271e_233b64eb","updated":"2020-04-08 23:06:44.000000000","message":"I think it\u0027s actually NEW_TO_LEGACY_LIMITS no?","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9f9e04965e090e9a572cd64f474e4277c2474df3","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"_ENFORCER \u003d None"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LEGACY_LIMITS \u003d {"},{"line_number":36,"context_line":"    \"servers\": \"instances\","},{"line_number":37,"context_line":"    \"class:VCPU\": \"cores\","},{"line_number":38,"context_line":"    \"class:MEMORY_MB\": \"ram\","}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_233b64eb","line":35,"in_reply_to":"df33271e_78f369e8","updated":"2020-04-08 15:05:34.000000000","message":"good point, LEGACY_TO_NEW_LIMITS?","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"bcf08bc5c569b6b291d338714e8417284ef2b699","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"_ENFORCER \u003d None"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LEGACY_LIMITS \u003d {"},{"line_number":36,"context_line":"    \"servers\": \"instances\","},{"line_number":37,"context_line":"    \"class:VCPU\": \"cores\","},{"line_number":38,"context_line":"    \"class:MEMORY_MB\": \"ram\","}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_255ce8eb","line":35,"in_reply_to":"df33271e_c58a6a19","updated":"2021-06-07 13:19:46.000000000","message":"oops, yes.","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7d691c4a31c32f3cf777a5bc4a448dc6c383b13e","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    legacy \u003d {}"},{"line_number":174,"context_line":"    for new_name, old_name in LEGACY_LIMITS.items():"},{"line_number":175,"context_line":"        # defensive incase oslo or keystone doesn\u0027t give us an answer"},{"line_number":176,"context_line":"        legacy[old_name] \u003d new_dict.get(new_name) or 0"},{"line_number":177,"context_line":"    return legacy"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_18a17daa","line":176,"range":{"start_line":176,"start_character":50,"end_line":176,"end_character":54},"updated":"2020-04-08 03:06:02.000000000","message":"I don\u0027t think there\u0027s testing of this part of the logic","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9f9e04965e090e9a572cd64f474e4277c2474df3","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    legacy \u003d {}"},{"line_number":174,"context_line":"    for new_name, old_name in LEGACY_LIMITS.items():"},{"line_number":175,"context_line":"        # defensive incase oslo or keystone doesn\u0027t give us an answer"},{"line_number":176,"context_line":"        legacy[old_name] \u003d new_dict.get(new_name) or 0"},{"line_number":177,"context_line":"    return legacy"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_c3339812","line":176,"range":{"start_line":176,"start_character":50,"end_line":176,"end_character":54},"in_reply_to":"df33271e_18a17daa","updated":"2020-04-08 15:05:34.000000000","message":"ah, I think you are correct","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7d691c4a31c32f3cf777a5bc4a448dc6c383b13e","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    # TODO(johngarbutt): need oslo.limit API for this, it should do caching"},{"line_number":183,"context_line":"    limit_utils \u003d limit._EnforcerUtils()"},{"line_number":184,"context_line":"    for new_name in LEGACY_LIMITS.keys():"},{"line_number":185,"context_line":"        max \u003d limit_utils._get_registered_limit(new_name)"},{"line_number":186,"context_line":"        new_limits[new_name] \u003d max"},{"line_number":187,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_78ca496e","line":185,"range":{"start_line":185,"start_character":8,"end_line":185,"end_character":11},"updated":"2020-04-08 03:06:02.000000000","message":"Sorry why is this called max? Also seems like you could just do \"new_limits[new_name]\" directly here.","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9f9e04965e090e9a572cd64f474e4277c2474df3","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    # TODO(johngarbutt): need oslo.limit API for this, it should do caching"},{"line_number":183,"context_line":"    limit_utils \u003d limit._EnforcerUtils()"},{"line_number":184,"context_line":"    for new_name in LEGACY_LIMITS.keys():"},{"line_number":185,"context_line":"        max \u003d limit_utils._get_registered_limit(new_name)"},{"line_number":186,"context_line":"        new_limits[new_name] \u003d max"},{"line_number":187,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_435ae84f","line":185,"range":{"start_line":185,"start_character":8,"end_line":185,"end_character":11},"in_reply_to":"df33271e_78ca496e","updated":"2020-04-08 15:05:34.000000000","message":"I think because limit clashed too much... its a poor name.","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d12851b06a5558ed3f433c42907ac7cde4bd6f80","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        try:"},{"line_number":196,"context_line":"            proj_limit \u003d limit_utils._get_limit(project_id, new_name)"},{"line_number":197,"context_line":"        except limit._LimitNotFound:"},{"line_number":198,"context_line":"            # If limit is not set, we don\u0027t allow use of this resource"},{"line_number":199,"context_line":"            proj_limit \u003d 0"},{"line_number":200,"context_line":"        new_limits[new_name] \u003d proj_limit"},{"line_number":201,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_e6834a55","line":198,"updated":"2020-04-08 15:16:10.000000000","message":"Yeah, so this should mention that if no project limit is set, and no registered limit is set, we tell the API the limit is 0, because that is how oslo-limit deals with this situation.","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7d691c4a31c32f3cf777a5bc4a448dc6c383b13e","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            proj_limit \u003d limit_utils._get_limit(project_id, new_name)"},{"line_number":197,"context_line":"        except limit._LimitNotFound:"},{"line_number":198,"context_line":"            # If limit is not set, we don\u0027t allow use of this resource"},{"line_number":199,"context_line":"            proj_limit \u003d 0"},{"line_number":200,"context_line":"        new_limits[new_name] \u003d proj_limit"},{"line_number":201,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":202,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_d877153a","line":199,"updated":"2020-04-08 03:06:02.000000000","message":"I\u0027m wondering about the effect of this on the scenario where there are default limits but no project limits set. If there is not a project limit set, the default limit should be used. If we fill in a limit of 0 here, wouldn\u0027t that override the default limit and be incorrect?","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d12851b06a5558ed3f433c42907ac7cde4bd6f80","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            proj_limit \u003d limit_utils._get_limit(project_id, new_name)"},{"line_number":197,"context_line":"        except limit._LimitNotFound:"},{"line_number":198,"context_line":"            # If limit is not set, we don\u0027t allow use of this resource"},{"line_number":199,"context_line":"            proj_limit \u003d 0"},{"line_number":200,"context_line":"        new_limits[new_name] \u003d proj_limit"},{"line_number":201,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":202,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_e6e86a17","line":199,"in_reply_to":"df33271e_63244cc7","updated":"2020-04-08 15:16:10.000000000","message":"sorry, _get_limit actually checks project and registered limits, so 0 only when neither are set, my comment and method name is very missleading here.","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9f9e04965e090e9a572cd64f474e4277c2474df3","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            proj_limit \u003d limit_utils._get_limit(project_id, new_name)"},{"line_number":197,"context_line":"        except limit._LimitNotFound:"},{"line_number":198,"context_line":"            # If limit is not set, we don\u0027t allow use of this resource"},{"line_number":199,"context_line":"            proj_limit \u003d 0"},{"line_number":200,"context_line":"        new_limits[new_name] \u003d proj_limit"},{"line_number":201,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":202,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_63244cc7","line":199,"in_reply_to":"df33271e_d877153a","updated":"2020-04-08 15:05:34.000000000","message":"This is used by the API. The way oslo.limit is implemented you can\u0027t create any instances, i.e. the limit is 0.","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"52946d3001a823eca2d43e8f2d7a3c37ca3047e2","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            proj_limit \u003d limit_utils._get_limit(project_id, new_name)"},{"line_number":197,"context_line":"        except limit._LimitNotFound:"},{"line_number":198,"context_line":"            # If limit is not set, we don\u0027t allow use of this resource"},{"line_number":199,"context_line":"            proj_limit \u003d 0"},{"line_number":200,"context_line":"        new_limits[new_name] \u003d proj_limit"},{"line_number":201,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":202,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_0580d2be","line":199,"in_reply_to":"df33271e_e6e86a17","updated":"2020-04-08 23:06:44.000000000","message":"OK, I looked at the code so I understand:\n\nhttps://github.com/openstack/oslo.limit/blob/485c770abf768383277c55f09146da0528c06953/oslo_limit/limit.py#L242\n\nSo you chose to call _get_limit instead of _get_project_limit so you could know if a limit has not been set either at the default level or at the project level.\n\nThe thing that seems wrong to me is that in the next patch, there\u0027s fallback logic for using local_limits if we don\u0027t have keystone_limits for a given resource, but AFAICT that logic will never be reached. See:\n\nhttps://review.opendev.org/#/c/713499/6/nova/quota.py@826\n\nAside, I think all of these could majorly use some code comments. Quotas are complicated IMHO and I think we would all appreciate more prose around here explaining what is happening and what\u0027s intended.","commit_id":"bc286109183ef0ae282843edff506640a1ecc451"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f1b3b0b3e1e7e56c7b3ff89183de606637651dfc","unresolved":true,"context_lines":[{"line_number":182,"context_line":"    # TODO(johngarbutt): need oslo.limit API for this, it should do caching"},{"line_number":183,"context_line":"    limit_utils \u003d limit._EnforcerUtils()"},{"line_number":184,"context_line":"    for new_name in LEGACY_LIMITS.keys():"},{"line_number":185,"context_line":"        max \u003d limit_utils._get_registered_limit(new_name)"},{"line_number":186,"context_line":"        new_limits[new_name] \u003d max"},{"line_number":187,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7c653874_25a83383","line":185,"range":{"start_line":185,"start_character":26,"end_line":185,"end_character":47},"updated":"2021-05-06 20:28:49.000000000","message":"The return value of this function is not an integer, it\u0027s a openstacksdk RegisteredLimit object [1]. So this needs to be instead:\n\n max \u003d limit_utils._get_registered_limit(new_name).default_limit\n\n[1] https://github.com/openstack/oslo.limit/blob/0820b8c38f92037592040c1215b4ec5e2d9f672c/oslo_limit/limit.py#L270","commit_id":"49cbbb50770c171fd38ed6402cbc75f4db88013d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"bcf08bc5c569b6b291d338714e8417284ef2b699","unresolved":true,"context_lines":[{"line_number":182,"context_line":"    # TODO(johngarbutt): need oslo.limit API for this, it should do caching"},{"line_number":183,"context_line":"    limit_utils \u003d limit._EnforcerUtils()"},{"line_number":184,"context_line":"    for new_name in LEGACY_LIMITS.keys():"},{"line_number":185,"context_line":"        max \u003d limit_utils._get_registered_limit(new_name)"},{"line_number":186,"context_line":"        new_limits[new_name] \u003d max"},{"line_number":187,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7685abc9_dd30b5a0","line":185,"range":{"start_line":185,"start_character":26,"end_line":185,"end_character":47},"in_reply_to":"1bcaef5e_408d7b31","updated":"2021-06-07 13:19:46.000000000","message":"Dan, I haven\u0027t started on the olso.limit to expose that properly, but +1 on doing it there.","commit_id":"49cbbb50770c171fd38ed6402cbc75f4db88013d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eab673ae95a951ed4fdbe5ab5a8917d3228d271e","unresolved":true,"context_lines":[{"line_number":182,"context_line":"    # TODO(johngarbutt): need oslo.limit API for this, it should do caching"},{"line_number":183,"context_line":"    limit_utils \u003d limit._EnforcerUtils()"},{"line_number":184,"context_line":"    for new_name in LEGACY_LIMITS.keys():"},{"line_number":185,"context_line":"        max \u003d limit_utils._get_registered_limit(new_name)"},{"line_number":186,"context_line":"        new_limits[new_name] \u003d max"},{"line_number":187,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"81acc941_2f4ef35f","line":185,"range":{"start_line":185,"start_character":26,"end_line":185,"end_character":47},"in_reply_to":"7685abc9_dd30b5a0","updated":"2021-06-07 13:48:36.000000000","message":"Okay, just in case you didn\u0027t see that I added you, I\u0027ve got something proposed here:\n\nhttps://review.opendev.org/c/openstack/oslo.limit/+/794851\n\nWhich works for me in glance locally.","commit_id":"49cbbb50770c171fd38ed6402cbc75f4db88013d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"45fd5f894f157a25b472845ae0256f3847304b9b","unresolved":true,"context_lines":[{"line_number":182,"context_line":"    # TODO(johngarbutt): need oslo.limit API for this, it should do caching"},{"line_number":183,"context_line":"    limit_utils \u003d limit._EnforcerUtils()"},{"line_number":184,"context_line":"    for new_name in LEGACY_LIMITS.keys():"},{"line_number":185,"context_line":"        max \u003d limit_utils._get_registered_limit(new_name)"},{"line_number":186,"context_line":"        new_limits[new_name] \u003d max"},{"line_number":187,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"e8327061_4c686c2c","line":185,"range":{"start_line":185,"start_character":26,"end_line":185,"end_character":47},"in_reply_to":"7c653874_25a83383","updated":"2021-05-11 19:31:32.000000000","message":"Also, we really need to fix oslo.limit to expose this stuff properly (as the comment says).\n\nJohn, do you have work started on this already? If not, I might get started on it. Glance has no API for exposing quota stats (because it currently has no quotas) but obviously exposing what the limit is for a user (registered or actual) is going to be something we need in order to expose usage info like that.","commit_id":"49cbbb50770c171fd38ed6402cbc75f4db88013d"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"61c4041da68ed06f25af725da985397ada1306ae","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    # TODO(johngarbutt): need oslo.limit API for this, it should do caching"},{"line_number":183,"context_line":"    limit_utils \u003d limit._EnforcerUtils()"},{"line_number":184,"context_line":"    for new_name in LEGACY_LIMITS.keys():"},{"line_number":185,"context_line":"        max \u003d limit_utils._get_registered_limit(new_name)"},{"line_number":186,"context_line":"        new_limits[new_name] \u003d max"},{"line_number":187,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"a3d095b4_a3f60e4d","line":185,"range":{"start_line":185,"start_character":26,"end_line":185,"end_character":47},"in_reply_to":"81acc941_2f4ef35f","updated":"2022-02-11 03:13:10.000000000","message":"Done","commit_id":"49cbbb50770c171fd38ed6402cbc75f4db88013d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"87a7a1c84ef519b23029971eb96bbaeca4831173","unresolved":true,"context_lines":[{"line_number":182,"context_line":"    # TODO(johngarbutt): need oslo.limit API for this, it should do caching"},{"line_number":183,"context_line":"    limit_utils \u003d limit._EnforcerUtils()"},{"line_number":184,"context_line":"    for new_name in LEGACY_LIMITS.keys():"},{"line_number":185,"context_line":"        max \u003d limit_utils._get_registered_limit(new_name)"},{"line_number":186,"context_line":"        new_limits[new_name] \u003d max"},{"line_number":187,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1bcaef5e_408d7b31","line":185,"range":{"start_line":185,"start_character":26,"end_line":185,"end_character":47},"in_reply_to":"e8327061_4c686c2c","updated":"2021-05-11 19:42:19.000000000","message":"I guess I should have been more explicit and said: mocking the internals of oslo.limit like this make this sort of bug a real danger. In glance, I tried to stick to mocking the keystone client API in order to make sure our interface with oslo.limit was mostly intact (although I copied the enforcement model mock from oslo.limit\u0027s own tests). Ideally oslo.limit would have something like the fixture I hacked together:\n\nhttps://review.opendev.org/c/openstack/glance/+/788054/5/glance/tests/unit/fixtures.py\n\n...but less sucky. The above only really works for a single call, but it was good enough for glance.","commit_id":"49cbbb50770c171fd38ed6402cbc75f4db88013d"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"42334424860820e089004f67bb26c4e8a18481d3","unresolved":true,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def get_legacy_project_limits(project_id):"},{"line_number":184,"context_line":"    new_limits \u003d {}"},{"line_number":185,"context_line":"    # TODO(johngarbutt): need oslo.limit API for this, it should do caching"},{"line_number":186,"context_line":"    limit_utils \u003d limit._EnforcerUtils()"},{"line_number":187,"context_line":"    for new_name in LEGACY_LIMITS.keys():"},{"line_number":188,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"2f2333fe_4647feb0","line":185,"updated":"2021-08-10 23:13:18.000000000","message":"Note to reviewers: I did look at trying to use the _EnforcerUtils.get_project_limits method to get project limits without enforcing, however, it raises ProjectOverLimit and will return no limits at all if any one of LEGACY_LIMITS are missing a limit in keystone [1].\n\nAFAICT I would have to query for each limit one by one in order to handle it, which is what the below code is already doing.\n\n[1] https://github.com/openstack/oslo.limit/blob/caa75c1babf1f06647761c1629b7ab8e055ddb3d/oslo_limit/limit.py#L296","commit_id":"f3a564632a5025551989a2f8843c4916801c95dc"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"61c4041da68ed06f25af725da985397ada1306ae","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def get_legacy_project_limits(project_id):"},{"line_number":184,"context_line":"    new_limits \u003d {}"},{"line_number":185,"context_line":"    # TODO(johngarbutt): need oslo.limit API for this, it should do caching"},{"line_number":186,"context_line":"    limit_utils \u003d limit._EnforcerUtils()"},{"line_number":187,"context_line":"    for new_name in LEGACY_LIMITS.keys():"},{"line_number":188,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"f8bf28e3_2d1177e0","line":185,"in_reply_to":"2f2333fe_4647feb0","updated":"2022-02-11 03:13:10.000000000","message":"Done","commit_id":"f3a564632a5025551989a2f8843c4916801c95dc"}],"nova/limit/placement.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"04f3ab4a1682695985e712d8029f815f20c37736","unresolved":true,"context_lines":[{"line_number":209,"context_line":"            project_id\u003dproject_id)"},{"line_number":210,"context_line":"        for proj_limit in proj_limits:"},{"line_number":211,"context_line":"            new_limits[new_name] \u003d ("},{"line_number":212,"context_line":"                proj_limit.resource_limit if proj_limit else 0)"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":215,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"71d7523a_585d6801","line":212,"updated":"2021-09-17 20:22:46.000000000","message":"This logic needs to fall back on querying registered limits if a project limit is not found before setting a limit to 0.","commit_id":"b9d26016c307f14343fd699f80f2731e782f8007"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b94e77a88556f2b1867aba7c116de01a48f19724","unresolved":false,"context_lines":[{"line_number":209,"context_line":"            project_id\u003dproject_id)"},{"line_number":210,"context_line":"        for proj_limit in proj_limits:"},{"line_number":211,"context_line":"            new_limits[new_name] \u003d ("},{"line_number":212,"context_line":"                proj_limit.resource_limit if proj_limit else 0)"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    return _convert_keys_to_legacy_name(new_limits)"},{"line_number":215,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"188583d5_c8c8edbb","line":212,"in_reply_to":"71d7523a_585d6801","updated":"2022-02-09 06:46:34.000000000","message":"Done","commit_id":"b9d26016c307f14343fd699f80f2731e782f8007"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"327f84b2e2c1bc8ef4e2abd517877c037a097c07","unresolved":true,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"def get_legacy_project_limits(project_id):"},{"line_number":191,"context_line":"    enforcer \u003d limit.Enforcer(lambda: None)"},{"line_number":192,"context_line":"    new_limits \u003d enforcer.get_project_limits(project_id, LEGACY_LIMITS.keys())"},{"line_number":193,"context_line":"    return _convert_keys_to_legacy_name(dict(new_limits))"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"6b0558ff_096f399c","line":192,"updated":"2022-02-02 16:33:41.000000000","message":"Does the comment from PS16[1] is resolved somewhere else? \n\n[1]https://review.opendev.org/c/openstack/nova/+/713498/comment/71d7523a_585d6801/","commit_id":"574632f509aab5e6c157bfaae6d34bcc49cfedab"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b94e77a88556f2b1867aba7c116de01a48f19724","unresolved":true,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"def get_legacy_project_limits(project_id):"},{"line_number":191,"context_line":"    enforcer \u003d limit.Enforcer(lambda: None)"},{"line_number":192,"context_line":"    new_limits \u003d enforcer.get_project_limits(project_id, LEGACY_LIMITS.keys())"},{"line_number":193,"context_line":"    return _convert_keys_to_legacy_name(dict(new_limits))"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"f2d2c2b3_41cf5378","line":192,"in_reply_to":"6b0558ff_096f399c","updated":"2022-02-09 06:46:34.000000000","message":"Yes, sorry for leaving that comment, it was collateral damage from before the upgrade to the new gerrit. That comment is resolved in oslo.limit itself:\n\nhttps://github.com/openstack/oslo.limit/blob/bf9deb10c3af4c43f6952f0fcedb9d48dfd8340d/oslo_limit/limit.py#L359\n\nwhere in version 1.5.0 there is a new get_project_limits() method that does the right thing to check (1) project limit (2) if no project limit, check for registered limit (3) if no registered limit return a limit of 0.","commit_id":"574632f509aab5e6c157bfaae6d34bcc49cfedab"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"61db256995f8fc55997da40b220d123896762491","unresolved":false,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"def get_legacy_project_limits(project_id):"},{"line_number":191,"context_line":"    enforcer \u003d limit.Enforcer(lambda: None)"},{"line_number":192,"context_line":"    new_limits \u003d enforcer.get_project_limits(project_id, LEGACY_LIMITS.keys())"},{"line_number":193,"context_line":"    return _convert_keys_to_legacy_name(dict(new_limits))"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"205b9bc5_3c91ea3c","line":192,"in_reply_to":"f2d2c2b3_41cf5378","updated":"2022-02-10 10:46:55.000000000","message":"thanks for the explanation.","commit_id":"574632f509aab5e6c157bfaae6d34bcc49cfedab"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e86eb7965d007f5adf4f69d8050a05e2dcf08fe9","unresolved":true,"context_lines":[{"line_number":178,"context_line":"    legacy \u003d {}"},{"line_number":179,"context_line":"    for new_name, old_name in LEGACY_LIMITS.items():"},{"line_number":180,"context_line":"        # defensive incase oslo or keystone doesn\u0027t give us an answer"},{"line_number":181,"context_line":"        legacy[old_name] \u003d new_dict.get(new_name) or 0"},{"line_number":182,"context_line":"    return legacy"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"c1963742_03c056c2","line":181,"updated":"2022-02-21 16:49:28.000000000","message":"cool to be 0.","commit_id":"1e01ea4591ac2b9502ef9f0c73c2e7e61cc32119"}],"nova/tests/unit/limit/test_keystone.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f1b3b0b3e1e7e56c7b3ff89183de606637651dfc","unresolved":true,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        mock_utils \u003d mock.MagicMock()"},{"line_number":241,"context_line":"        mock_utils_class.return_value \u003d mock_utils"},{"line_number":242,"context_line":"        mock_utils._get_registered_limit.side_effect \u003d _fake_limit"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        limits \u003d keystone_limits.get_legacy_default_limits()"},{"line_number":245,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"6522181f_41299bd0","line":242,"updated":"2021-05-06 20:28:49.000000000","message":"This needs to be:\n\n mock_utils._get_registered_limit.default_limit.side_effect \u003d _fake_limit","commit_id":"49cbbb50770c171fd38ed6402cbc75f4db88013d"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"61c4041da68ed06f25af725da985397ada1306ae","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        mock_utils \u003d mock.MagicMock()"},{"line_number":241,"context_line":"        mock_utils_class.return_value \u003d mock_utils"},{"line_number":242,"context_line":"        mock_utils._get_registered_limit.side_effect \u003d _fake_limit"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        limits \u003d keystone_limits.get_legacy_default_limits()"},{"line_number":245,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"04cec470_a8273e12","line":242,"in_reply_to":"6522181f_41299bd0","updated":"2022-02-11 03:13:10.000000000","message":"Done","commit_id":"49cbbb50770c171fd38ed6402cbc75f4db88013d"}]}
