)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"41d9f3b7fd663760d8bf0f409bd4643fa254c7d6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":49,"id":"516fadcf_0037f19a","updated":"2021-11-10 23:24:07.000000000","message":"recheck","commit_id":"aceaf4f80f4cfc22646f93635bb884f5f051268b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"64026df2d82cbb594c5e3bce68fb860fe98a4732","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":52,"id":"40812e99_7a96e632","updated":"2022-01-21 19:52:43.000000000","message":"recheck bug 1957941","commit_id":"e1c63b1ca1ed8cb0c8966acd6bdd046e2826a69e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"9d91aede0dc46a02856c4550a381561798f57d33","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":52,"id":"fbb069d9_8ceed38c","updated":"2022-01-21 01:08:00.000000000","message":"recheck dep updated","commit_id":"e1c63b1ca1ed8cb0c8966acd6bdd046e2826a69e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"0a88dba3fd9af23e928fd8fa080ad0d6c4affa3e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":53,"id":"38953960_507f0e09","updated":"2022-01-27 20:32:25.000000000","message":"recheck bug 1944779","commit_id":"9eca1d26e671069a8c1d5b11f27439af99cc75b8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f62651f390f30483beffab87d42ff5a26d1e1657","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":54,"id":"f9df1b99_1c128c60","updated":"2022-02-02 16:27:38.000000000","message":"recheck nova-next has been fixed\nLooks good, the nits inline can be fixed in a follow up","commit_id":"0eaae1fcbad02d411b78cb65b61a727ed7582ab7"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"8fd595b5cb66e9c833fbcad10cab7dd59cd4da6c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":59,"id":"28793c59_58bdb4c1","updated":"2022-02-25 12:53:12.000000000","message":"recheck","commit_id":"140b3b81f924c98299c361a76042873b77745fbe"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5ca808c03d31cd9c40cd3606711ceb64082f9ac8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":59,"id":"6312e2cf_91ddaa31","updated":"2022-02-24 22:07:29.000000000","message":"recheck","commit_id":"140b3b81f924c98299c361a76042873b77745fbe"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"638febdd2b04166694380263b011791d11f7c710","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":59,"id":"87ee99d7_f37b5427","updated":"2022-02-26 09:21:19.000000000","message":"recheck","commit_id":"140b3b81f924c98299c361a76042873b77745fbe"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e797b218799bfe79be1aec9a6c93a38b0cbe7d05","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":59,"id":"eddeb8d7_753580f6","updated":"2022-02-26 18:44:08.000000000","message":"recheck","commit_id":"140b3b81f924c98299c361a76042873b77745fbe"}],"nova/api/openstack/compute/server_groups.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"dce8a988d0b04fd4d46ceab73a19219304de046a","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                objects.Quotas.check_deltas(context, {\u0027server_groups\u0027: 0},"},{"line_number":220,"context_line":"                                            context.project_id,"},{"line_number":221,"context_line":"                                            context.user_id)"},{"line_number":222,"context_line":"                # NOTE(johngarbutt): no recheck in unified limits"},{"line_number":223,"context_line":"            except nova.exception.OverQuota:"},{"line_number":224,"context_line":"                sg.destroy()"},{"line_number":225,"context_line":"                msg \u003d _(\"Quota exceeded, too many server groups.\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_e8e180fd","line":222,"updated":"2019-11-21 18:05:33.000000000","message":"Hm, I thought there would be. We need a recheck for \"strict quota\" during parallel request scenarios. During past oslo.limit discussions, there was going to be a \"verify\" method available to call to do the same thing as recheck. Is that no longer the case?\n\nI\u0027m concerned about regressing behavior where there\u0027s no longer a way for operators to enforce strict quota limits in the presence of parallel competing requests.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                objects.Quotas.check_deltas(context, {\u0027server_groups\u0027: 0},"},{"line_number":220,"context_line":"                                            context.project_id,"},{"line_number":221,"context_line":"                                            context.user_id)"},{"line_number":222,"context_line":"                # NOTE(johngarbutt): no recheck in unified limits"},{"line_number":223,"context_line":"            except nova.exception.OverQuota:"},{"line_number":224,"context_line":"                sg.destroy()"},{"line_number":225,"context_line":"                msg \u003d _(\"Quota exceeded, too many server groups.\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_f2daaae3","line":222,"in_reply_to":"3fa7e38b_e8e180fd","updated":"2019-11-25 13:04:42.000000000","message":"I attempted to justfy this in the spec, I guess I didn\u0027t do that well enough yet.\n\nAs an operator, I only care about the race for things that really use resources, i.e. things that are moving to oslo.limit based enforement.\n\nGiven these are demoted to config options, I drop the re-check here. The race, while possible, is a very small window here, and doesn\u0027t really matter all that much. If it really mattered, we should move it into unified limits.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"}],"nova/compute/api.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"1cc8619079357aa78fb8c658e0acffa70b4c3cda","unresolved":false,"context_lines":[{"line_number":5662,"context_line":"            try:"},{"line_number":5663,"context_line":"                objects.Quotas.check_deltas(context, {\u0027key_pairs\u0027: 0}, user_id)"},{"line_number":5664,"context_line":"                # TODO(johngarbutt) do we really need this one?"},{"line_number":5665,"context_line":"                # limit.check_static_limit(context, \u0027key_pairs\u0027, user_id)"},{"line_number":5666,"context_line":"            except exception.OverQuota:"},{"line_number":5667,"context_line":"                keypair.destroy()"},{"line_number":5668,"context_line":"                raise exception.KeypairLimitExceeded()"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_27114eaf","line":5665,"updated":"2018-11-05 16:06:10.000000000","message":"During the PTG, we thought keeping this a static check was the right path forward.","commit_id":"900413d7c228ce0f59f5b4de96a1b28b212c4503"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"723db1bef5b4e6fede5598287eb369a8c77eacb6","unresolved":false,"context_lines":[{"line_number":5662,"context_line":"            try:"},{"line_number":5663,"context_line":"                objects.Quotas.check_deltas(context, {\u0027key_pairs\u0027: 0}, user_id)"},{"line_number":5664,"context_line":"                # TODO(johngarbutt) do we really need this one?"},{"line_number":5665,"context_line":"                # limit.check_static_limit(context, \u0027key_pairs\u0027, user_id)"},{"line_number":5666,"context_line":"            except exception.OverQuota:"},{"line_number":5667,"context_line":"                keypair.destroy()"},{"line_number":5668,"context_line":"                raise exception.KeypairLimitExceeded()"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_50d8a9eb","line":5665,"in_reply_to":"3f79a3b5_27114eaf","updated":"2018-11-06 14:04:58.000000000","message":"The check on line5591 we totally keep.\n\nI am thinking we should not bother with the re-checking of these ones, because the window between the check and its creation is so small (unlike during server build), and has such a low impact if we are a little bit over quota.","commit_id":"900413d7c228ce0f59f5b4de96a1b28b212c4503"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"838cfb3dcc4d866c1556614560682ecc75cedd2c","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            objects.Quotas.limit_check(context,"},{"line_number":306,"context_line":"                                       injected_files\u003dlen(injected_files))"},{"line_number":307,"context_line":"            local_limits.check_count(local_limits.INJECTED_FILES,"},{"line_number":308,"context_line":"                                     len(injected_files))"},{"line_number":309,"context_line":"        except exception.OverQuota:"},{"line_number":310,"context_line":"            raise exception.OnsetFileLimitExceeded()"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_8ed575b9","line":308,"updated":"2019-11-21 19:22:47.000000000","message":"Don\u0027t we need an if/else or try-except situation here for legacy limits vs unified limits instead of calling both?","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            objects.Quotas.limit_check(context,"},{"line_number":306,"context_line":"                                       injected_files\u003dlen(injected_files))"},{"line_number":307,"context_line":"            local_limits.check_count(local_limits.INJECTED_FILES,"},{"line_number":308,"context_line":"                                     len(injected_files))"},{"line_number":309,"context_line":"        except exception.OverQuota:"},{"line_number":310,"context_line":"            raise exception.OnsetFileLimitExceeded()"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_929496e9","line":308,"in_reply_to":"3fa7e38b_8ed575b9","updated":"2019-11-25 13:04:42.000000000","message":"To keep it simple, the first one will always pass when unified limits is turned on, at least that was my plan.\n\nI didn\u0027t want to scatter all calling points with that if/else logic.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6ba4981b268f76dd2b47f43aed310a5f6699e2d7","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            objects.Quotas.limit_check(context,"},{"line_number":306,"context_line":"                                       injected_files\u003dlen(injected_files))"},{"line_number":307,"context_line":"            local_limits.check_count(local_limits.INJECTED_FILES,"},{"line_number":308,"context_line":"                                     len(injected_files))"},{"line_number":309,"context_line":"        except exception.OverQuota:"},{"line_number":310,"context_line":"            raise exception.OnsetFileLimitExceeded()"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_ec12cd54","line":308,"in_reply_to":"3fa7e38b_929496e9","updated":"2019-11-25 17:05:34.000000000","message":"Ah, that does make sense and is better I think. I just missed the connection in the limit check methods.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"838cfb3dcc4d866c1556614560682ecc75cedd2c","unresolved":false,"context_lines":[{"line_number":6036,"context_line":"            try:"},{"line_number":6037,"context_line":"                objects.Quotas.check_deltas(context, {\u0027key_pairs\u0027: 0}, user_id)"},{"line_number":6038,"context_line":"                # TODO(johngarbutt) do we really need this one?"},{"line_number":6039,"context_line":"                # limit.check_static_limit(context, \u0027key_pairs\u0027, user_id)"},{"line_number":6040,"context_line":"            except exception.OverQuota:"},{"line_number":6041,"context_line":"                keypair.destroy()"},{"line_number":6042,"context_line":"                raise exception.KeypairLimitExceeded()"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_ee05097b","line":6039,"updated":"2019-11-21 19:22:47.000000000","message":"This recheck is meant for this case:\n\nhttps://bugs.launchpad.net/nova/+bug/1301532","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6ba4981b268f76dd2b47f43aed310a5f6699e2d7","unresolved":false,"context_lines":[{"line_number":6036,"context_line":"            try:"},{"line_number":6037,"context_line":"                objects.Quotas.check_deltas(context, {\u0027key_pairs\u0027: 0}, user_id)"},{"line_number":6038,"context_line":"                # TODO(johngarbutt) do we really need this one?"},{"line_number":6039,"context_line":"                # limit.check_static_limit(context, \u0027key_pairs\u0027, user_id)"},{"line_number":6040,"context_line":"            except exception.OverQuota:"},{"line_number":6041,"context_line":"                keypair.destroy()"},{"line_number":6042,"context_line":"                raise exception.KeypairLimitExceeded()"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_ac4ff567","line":6039,"in_reply_to":"3fa7e38b_d28d2ed4","updated":"2019-11-25 17:05:34.000000000","message":"Now that you say this, I think we discussed this on the spec already and then I forgot. :( Sorry about that.\n\nI have a sneaking suspicion we\u0027re going to have to re-explain this to people repeatedly, so I do wonder if we should add a brief code comment explaining why at each site.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":6036,"context_line":"            try:"},{"line_number":6037,"context_line":"                objects.Quotas.check_deltas(context, {\u0027key_pairs\u0027: 0}, user_id)"},{"line_number":6038,"context_line":"                # TODO(johngarbutt) do we really need this one?"},{"line_number":6039,"context_line":"                # limit.check_static_limit(context, \u0027key_pairs\u0027, user_id)"},{"line_number":6040,"context_line":"            except exception.OverQuota:"},{"line_number":6041,"context_line":"                keypair.destroy()"},{"line_number":6042,"context_line":"                raise exception.KeypairLimitExceeded()"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_d28d2ed4","line":6039,"in_reply_to":"3fa7e38b_ee05097b","updated":"2019-11-25 13:04:42.000000000","message":"Agreed, it just doesn\u0027t seem serious enough for the extra complexity.\n\nIf we really think its is a problem, we should probably remove the configuration \"if\" block for these.\n\nYou would need to become many, many different users within a project to exploit this properly. And when you can do that, game over even with this check. I think, anyways.\n\nGiven its cheap to check, I would argue doing the check always.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3804912e411834e9f261805e1fa82ca46dc4a815","unresolved":false,"context_lines":[{"line_number":1246,"context_line":"                if block_device_mapping:"},{"line_number":1247,"context_line":"                    # Record whether or not we are a BFV instance"},{"line_number":1248,"context_line":"                    root \u003d block_device_mapping.root_bdm()"},{"line_number":1249,"context_line":"                    req_spec.is_bfv \u003d bool(root and root.is_volume)"},{"line_number":1250,"context_line":"                else:"},{"line_number":1251,"context_line":"                    # If we have no BDMs, we\u0027re clearly not BFV"},{"line_number":1252,"context_line":"                    req_spec.is_bfv \u003d False"},{"line_number":1253,"context_line":""},{"line_number":1254,"context_line":"                # NOTE(danms): We need to record num_instances on the request"},{"line_number":1255,"context_line":"                # spec as this is how the conductor knows how many were in this"}],"source_content_type":"text/x-python","patch_set":23,"id":"df33271e_71558450","line":1252,"range":{"start_line":1249,"start_character":20,"end_line":1252,"end_character":43},"updated":"2020-03-24 01:43:46.000000000","message":"Note that we have the ability to determine is_bfv here ... it seems like we should be able to move this logic earlier to get whether is_bfv and then pass that on to enforce_num_instances to avoid making the assumption mentioned here, unless I\u0027m missing something:\n\nhttps://review.opendev.org/#/c/713301/1/nova/scheduler/utils.py@567","commit_id":"d8f93fa5316e5760e8190661056d423728a69a7b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f3998eb3d7c089d2a79868843b9656af1f6bc577","unresolved":false,"context_lines":[{"line_number":1246,"context_line":"                if block_device_mapping:"},{"line_number":1247,"context_line":"                    # Record whether or not we are a BFV instance"},{"line_number":1248,"context_line":"                    root \u003d block_device_mapping.root_bdm()"},{"line_number":1249,"context_line":"                    req_spec.is_bfv \u003d bool(root and root.is_volume)"},{"line_number":1250,"context_line":"                else:"},{"line_number":1251,"context_line":"                    # If we have no BDMs, we\u0027re clearly not BFV"},{"line_number":1252,"context_line":"                    req_spec.is_bfv \u003d False"},{"line_number":1253,"context_line":""},{"line_number":1254,"context_line":"                # NOTE(danms): We need to record num_instances on the request"},{"line_number":1255,"context_line":"                # spec as this is how the conductor knows how many were in this"}],"source_content_type":"text/x-python","patch_set":23,"id":"df33271e_ab278b12","line":1252,"range":{"start_line":1249,"start_character":20,"end_line":1252,"end_character":43},"in_reply_to":"df33271e_71558450","updated":"2020-03-24 16:56:17.000000000","message":"totally agreed, going to try and fix that up.","commit_id":"d8f93fa5316e5760e8190661056d423728a69a7b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"2f66ee9af030155b471be9e77c0f64fa8d9d6419","unresolved":false,"context_lines":[{"line_number":1221,"context_line":"        #   returns num_instances back again"},{"line_number":1222,"context_line":"        num_instances \u003d keystone_limits.enforce_num_instances("},{"line_number":1223,"context_line":"                context, context.project_id, instance_type,"},{"line_number":1224,"context_line":"                is_bfv, min_count, num_instances)"},{"line_number":1225,"context_line":""},{"line_number":1226,"context_line":"        security_groups \u003d security_group_api.populate_security_groups("},{"line_number":1227,"context_line":"                security_groups)"}],"source_content_type":"text/x-python","patch_set":29,"id":"df33271e_e5b96e79","line":1224,"updated":"2020-04-08 23:26:38.000000000","message":"Just noting that this is a little odd that we call legacy quotas at L1209 and then replace them here if keystone limits are not used.\n\n(later) OK, so this will just return the previously calculated num_instances if keystone limits are not configured. That makes sense but at least for me it would have helped to add the words \"previously calculated\". At first glance, I thought this was going to wipe out the calc that happened on L1209 in the case of no keystone limits.","commit_id":"6e26d5f4c4fdef87148216f850a4d436a2f0b4b2"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"78196cc93183d871075b1d74c756ea72c83bf320","unresolved":false,"context_lines":[{"line_number":1221,"context_line":"        #   returns num_instances back again"},{"line_number":1222,"context_line":"        num_instances \u003d keystone_limits.enforce_num_instances("},{"line_number":1223,"context_line":"                context, context.project_id, instance_type,"},{"line_number":1224,"context_line":"                is_bfv, min_count, num_instances)"},{"line_number":1225,"context_line":""},{"line_number":1226,"context_line":"        security_groups \u003d security_group_api.populate_security_groups("},{"line_number":1227,"context_line":"                security_groups)"}],"source_content_type":"text/x-python","patch_set":29,"id":"df33271e_c5bc1c08","line":1224,"in_reply_to":"df33271e_e5b96e79","updated":"2020-04-09 13:30:03.000000000","message":"yeah, I will update the comment.\n\nThe basic problem with moving ln1209 is it screws up the unit tests more than is worth it. I will try a bit of a spacing change to see if this reads better.","commit_id":"6e26d5f4c4fdef87148216f850a4d436a2f0b4b2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2e22145da1c96ab66be2fb919f9e3ca2a450effd","unresolved":true,"context_lines":[{"line_number":1307,"context_line":"            # but needs to match the zone that the volumes are in so update"},{"line_number":1308,"context_line":"            # base_options to match the volume zone."},{"line_number":1309,"context_line":"            base_options[\u0027availability_zone\u0027] \u003d volume_az"},{"line_number":1310,"context_line":""},{"line_number":1311,"context_line":"        LOG.debug(\"Going to run %s instances...\", num_instances)"},{"line_number":1312,"context_line":"        extra_specs \u003d instance_type.extra_specs"},{"line_number":1313,"context_line":"        dp_name \u003d extra_specs.get(\u0027accel:device_profile\u0027)"}],"source_content_type":"text/x-python","patch_set":31,"id":"fde6f4e2_a7018153","line":1310,"updated":"2021-05-11 19:26:30.000000000","message":"Bzzt :)","commit_id":"12addffa51a2eef145c4601f1d182f7bb451f595"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"9daa549adbefed2fb685316587ef3daaaeebb654","unresolved":false,"context_lines":[{"line_number":1307,"context_line":"            # but needs to match the zone that the volumes are in so update"},{"line_number":1308,"context_line":"            # base_options to match the volume zone."},{"line_number":1309,"context_line":"            base_options[\u0027availability_zone\u0027] \u003d volume_az"},{"line_number":1310,"context_line":""},{"line_number":1311,"context_line":"        LOG.debug(\"Going to run %s instances...\", num_instances)"},{"line_number":1312,"context_line":"        extra_specs \u003d instance_type.extra_specs"},{"line_number":1313,"context_line":"        dp_name \u003d extra_specs.get(\u0027accel:device_profile\u0027)"}],"source_content_type":"text/x-python","patch_set":31,"id":"21564d6f_89d49b22","line":1310,"in_reply_to":"674b1b62_84c8cf7b","updated":"2022-02-09 06:46:18.000000000","message":"Done","commit_id":"12addffa51a2eef145c4601f1d182f7bb451f595"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1deb56c7d07ee76ee1f52086bd18eb32f9f0e5eb","unresolved":true,"context_lines":[{"line_number":1307,"context_line":"            # but needs to match the zone that the volumes are in so update"},{"line_number":1308,"context_line":"            # base_options to match the volume zone."},{"line_number":1309,"context_line":"            base_options[\u0027availability_zone\u0027] \u003d volume_az"},{"line_number":1310,"context_line":""},{"line_number":1311,"context_line":"        LOG.debug(\"Going to run %s instances...\", num_instances)"},{"line_number":1312,"context_line":"        extra_specs \u003d instance_type.extra_specs"},{"line_number":1313,"context_line":"        dp_name \u003d extra_specs.get(\u0027accel:device_profile\u0027)"}],"source_content_type":"text/x-python","patch_set":31,"id":"674b1b62_84c8cf7b","line":1310,"in_reply_to":"ccf6f771_421fe32f","updated":"2021-08-10 15:15:28.000000000","message":"Unrelated whitespace damage.","commit_id":"12addffa51a2eef145c4601f1d182f7bb451f595"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a71a86161c9b5113d1354a672404f07460dc5bec","unresolved":true,"context_lines":[{"line_number":1307,"context_line":"            # but needs to match the zone that the volumes are in so update"},{"line_number":1308,"context_line":"            # base_options to match the volume zone."},{"line_number":1309,"context_line":"            base_options[\u0027availability_zone\u0027] \u003d volume_az"},{"line_number":1310,"context_line":""},{"line_number":1311,"context_line":"        LOG.debug(\"Going to run %s instances...\", num_instances)"},{"line_number":1312,"context_line":"        extra_specs \u003d instance_type.extra_specs"},{"line_number":1313,"context_line":"        dp_name \u003d extra_specs.get(\u0027accel:device_profile\u0027)"}],"source_content_type":"text/x-python","patch_set":31,"id":"ccf6f771_421fe32f","line":1310,"in_reply_to":"fde6f4e2_a7018153","updated":"2021-08-07 05:26:57.000000000","message":"What does this mean? 😆","commit_id":"12addffa51a2eef145c4601f1d182f7bb451f595"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f62651f390f30483beffab87d42ff5a26d1e1657","unresolved":true,"context_lines":[{"line_number":1366,"context_line":""},{"line_number":1367,"context_line":"        # NOTE(johngarbutt) when unified limits not used, this just"},{"line_number":1368,"context_line":"        #   returns num_instances back again"},{"line_number":1369,"context_line":"        num_instances \u003d placement_limits.enforce_num_instances_and_flavor("},{"line_number":1370,"context_line":"                context, context.project_id, flavor,"},{"line_number":1371,"context_line":"                is_bfv, min_count, num_instances)"},{"line_number":1372,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"690c50dd_2f0a8d18","line":1369,"updated":"2022-02-02 16:27:38.000000000","message":"Probably make sense to note here that: If we ever want to enforce quote on port or cyborg resources then we need to move this quota check after L1431 as that is the point where the request spec is populated with all the requested resources. There instead of getting deltas from the flavor via a fake request spec, we can use the real request spec to get the overall resource usage of the instance.","commit_id":"0eaae1fcbad02d411b78cb65b61a727ed7582ab7"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"9daa549adbefed2fb685316587ef3daaaeebb654","unresolved":false,"context_lines":[{"line_number":1366,"context_line":""},{"line_number":1367,"context_line":"        # NOTE(johngarbutt) when unified limits not used, this just"},{"line_number":1368,"context_line":"        #   returns num_instances back again"},{"line_number":1369,"context_line":"        num_instances \u003d placement_limits.enforce_num_instances_and_flavor("},{"line_number":1370,"context_line":"                context, context.project_id, flavor,"},{"line_number":1371,"context_line":"                is_bfv, min_count, num_instances)"},{"line_number":1372,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"c4bc8204_4f9fc8c0","line":1369,"in_reply_to":"690c50dd_2f0a8d18","updated":"2022-02-09 06:46:18.000000000","message":"Done","commit_id":"0eaae1fcbad02d411b78cb65b61a727ed7582ab7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f62651f390f30483beffab87d42ff5a26d1e1657","unresolved":true,"context_lines":[{"line_number":3808,"context_line":"        project_id, user_id \u003d quotas_obj.ids_from_instance(context,"},{"line_number":3809,"context_line":"                                                           instance)"},{"line_number":3810,"context_line":"        # NOTE(johngarbutt) for resize, check for sum of existing usage"},{"line_number":3811,"context_line":"        # and extra usage from new flavor, as it will be claimed in"},{"line_number":3812,"context_line":"        # placement that way, even if there is no change in flavor"},{"line_number":3813,"context_line":"        # But for revert resize, we are just removing claims in placement"},{"line_number":3814,"context_line":"        # so we can ignore the quota check"}],"source_content_type":"text/x-python","patch_set":54,"id":"631f5963_c3f9e100","line":3811,"range":{"start_line":3811,"start_character":14,"end_line":3811,"end_character":41},"updated":"2022-02-02 16:27:38.000000000","message":"I think \"extra usage\" can be misleading here. As extra might mean new_flavor - current_flavor, the \"increase\". But actually we checking against current_flavor + new_flavor. And I think the code logic is correct as it is really how we allocate the resources in placement during the resize operation (until confirm or revert removes one of the flavor\u0027s allocation)","commit_id":"0eaae1fcbad02d411b78cb65b61a727ed7582ab7"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"9daa549adbefed2fb685316587ef3daaaeebb654","unresolved":false,"context_lines":[{"line_number":3808,"context_line":"        project_id, user_id \u003d quotas_obj.ids_from_instance(context,"},{"line_number":3809,"context_line":"                                                           instance)"},{"line_number":3810,"context_line":"        # NOTE(johngarbutt) for resize, check for sum of existing usage"},{"line_number":3811,"context_line":"        # and extra usage from new flavor, as it will be claimed in"},{"line_number":3812,"context_line":"        # placement that way, even if there is no change in flavor"},{"line_number":3813,"context_line":"        # But for revert resize, we are just removing claims in placement"},{"line_number":3814,"context_line":"        # so we can ignore the quota check"}],"source_content_type":"text/x-python","patch_set":54,"id":"92c66598_9666f5d6","line":3811,"range":{"start_line":3811,"start_character":14,"end_line":3811,"end_character":41},"in_reply_to":"631f5963_c3f9e100","updated":"2022-02-09 06:46:18.000000000","message":"Done","commit_id":"0eaae1fcbad02d411b78cb65b61a727ed7582ab7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f62651f390f30483beffab87d42ff5a26d1e1657","unresolved":true,"context_lines":[{"line_number":3814,"context_line":"        # so we can ignore the quota check"},{"line_number":3815,"context_line":"        if not is_revert:"},{"line_number":3816,"context_line":"            placement_limits.enforce_num_instances_and_flavor(context,"},{"line_number":3817,"context_line":"                                                             project_id,"},{"line_number":3818,"context_line":"                                                             new_flavor,"},{"line_number":3819,"context_line":"                                                             is_bfv, 1, 1)"},{"line_number":3820,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"6fad7ed5_aee8b2c9","line":3817,"range":{"start_line":3817,"start_character":61,"end_line":3817,"end_character":62},"updated":"2022-02-02 16:27:38.000000000","message":"this is underindented, the p should be in the same column as the c above. But I would prefer wrapping the line after the ( instead.","commit_id":"0eaae1fcbad02d411b78cb65b61a727ed7582ab7"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"9daa549adbefed2fb685316587ef3daaaeebb654","unresolved":false,"context_lines":[{"line_number":3814,"context_line":"        # so we can ignore the quota check"},{"line_number":3815,"context_line":"        if not is_revert:"},{"line_number":3816,"context_line":"            placement_limits.enforce_num_instances_and_flavor(context,"},{"line_number":3817,"context_line":"                                                             project_id,"},{"line_number":3818,"context_line":"                                                             new_flavor,"},{"line_number":3819,"context_line":"                                                             is_bfv, 1, 1)"},{"line_number":3820,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"cd50e669_1267ce3f","line":3817,"range":{"start_line":3817,"start_character":61,"end_line":3817,"end_character":62},"in_reply_to":"6fad7ed5_aee8b2c9","updated":"2022-02-09 06:46:18.000000000","message":"Done","commit_id":"0eaae1fcbad02d411b78cb65b61a727ed7582ab7"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"71ec1d343429bb0505b1efd10a048b86d8fb8b43","unresolved":true,"context_lines":[{"line_number":1355,"context_line":"            is_bfv \u003d bool(root and root.is_volume)"},{"line_number":1356,"context_line":"        else:"},{"line_number":1357,"context_line":"            # If we have no BDMs, we\u0027re clearly not BFV"},{"line_number":1358,"context_line":"            is_bfv \u003d False"},{"line_number":1359,"context_line":""},{"line_number":1360,"context_line":"        # NOTE(johngarbutt) when unified limits not used, this just"},{"line_number":1361,"context_line":"        #   returns num_instances back again"}],"source_content_type":"text/x-python","patch_set":58,"id":"aab8e21a_1b0c7349","line":1358,"updated":"2022-02-21 16:08:18.000000000","message":"++","commit_id":"9f19fb30d71a4eaede86470c4b4e19afbb4ba806"}],"nova/conductor/manager.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"66af06ce8ac867e8ffc8fe4ad6a366c74c65aca7","unresolved":false,"context_lines":[{"line_number":1483,"context_line":"                    context, instance.flavor, 0, 0,"},{"line_number":1484,"context_line":"                    orig_num_req\u003dlen(build_requests))"},{"line_number":1485,"context_line":"                keystone_limits.enforce_num_instances("},{"line_number":1486,"context_line":"                    context, context.project_id, instance.flavor, 0, 0)"},{"line_number":1487,"context_line":"            except exception.TooManyInstances as exc:"},{"line_number":1488,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1489,"context_line":"                    self._cleanup_build_artifacts(context, exc, instances,"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fa7e38b_2bc5015d","line":1486,"updated":"2019-11-27 22:49:55.000000000","message":"OK cool, so instead of a separate oslo.limit \"verify\" method, we\u0027ll just use the same method and pass 0 deltas (like today). Works for me.","commit_id":"f0a8d60275266396603d730c290809f57f8b8b9b"}],"nova/conf/quota.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"aa2fc6ad762c29ab0fd2a3d8becce64a4645f013","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        default\u003dFalse,"},{"line_number":30,"context_line":"        help\u003d\"\"\""},{"line_number":31,"context_line":"When true, oslo.limit is used to enforce quotas in Nova via oslo_limit,"},{"line_number":32,"context_line":"and hard codes the quota driver to be no_op."},{"line_number":33,"context_line":"TODO: details."},{"line_number":34,"context_line":"\"\"\"),"},{"line_number":35,"context_line":"    cfg.IntOpt(\u0027instances\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_74d636fb","line":32,"updated":"2018-11-02 15:38:46.000000000","message":"This is only going to be used for \"dynamic\" resource quotas though, right? Should we list those here, or somewhere else? Or do users care if oslo.limit does anything keypair quotas?","commit_id":"fc8cdf0115d330e6f14a884dc6b42157b5f692e9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"8802c1f26d4f8fe451a5a81f1eda71752d2a8945","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        default\u003dFalse,"},{"line_number":30,"context_line":"        help\u003d\"\"\""},{"line_number":31,"context_line":"When true, oslo.limit is used to enforce quotas in Nova via oslo_limit,"},{"line_number":32,"context_line":"and hard codes the quota driver to be no_op."},{"line_number":33,"context_line":"TODO: details."},{"line_number":34,"context_line":"\"\"\"),"},{"line_number":35,"context_line":"    cfg.IntOpt(\u0027instances\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_839156f9","line":32,"in_reply_to":"3f79a3b5_74d636fb","updated":"2018-11-02 17:50:03.000000000","message":"So I think this needs a better name, now you point this out.\n\nThis is more an upgrade thing, lots more to describe around what this means... It is basically opt into the new quota system, throw away the old quota system.","commit_id":"fc8cdf0115d330e6f14a884dc6b42157b5f692e9"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"aa2fc6ad762c29ab0fd2a3d8becce64a4645f013","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        deprecated_for_removal\u003dTrue,"},{"line_number":71,"context_line":"        deprecated_since\u003d\u002719.0.0\u0027,"},{"line_number":72,"context_line":"        deprecated_reason\u003d\"\"\""},{"line_number":73,"context_line":"When using oslo.limit this has no meaning, the default is in Keystone.\"\"\","},{"line_number":74,"context_line":"        min\u003d-1,"},{"line_number":75,"context_line":"        default\u003d50 * 1024,"},{"line_number":76,"context_line":"        deprecated_group\u003d\u0027DEFAULT\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_54fc5a70","line":73,"range":{"start_line":73,"start_character":61,"end_line":73,"end_character":69},"updated":"2018-11-02 15:38:46.000000000","message":"For the sake of consistent terminology, we could reference the \"default\" here as the registered limit in keystone.","commit_id":"fc8cdf0115d330e6f14a884dc6b42157b5f692e9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"8802c1f26d4f8fe451a5a81f1eda71752d2a8945","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        deprecated_for_removal\u003dTrue,"},{"line_number":71,"context_line":"        deprecated_since\u003d\u002719.0.0\u0027,"},{"line_number":72,"context_line":"        deprecated_reason\u003d\"\"\""},{"line_number":73,"context_line":"When using oslo.limit this has no meaning, the default is in Keystone.\"\"\","},{"line_number":74,"context_line":"        min\u003d-1,"},{"line_number":75,"context_line":"        default\u003d50 * 1024,"},{"line_number":76,"context_line":"        deprecated_group\u003d\u0027DEFAULT\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_a38b32bf","line":73,"range":{"start_line":73,"start_character":61,"end_line":73,"end_character":69},"in_reply_to":"3f79a3b5_54fc5a70","updated":"2018-11-02 17:50:03.000000000","message":"yeah, I should fix that wording, good point.","commit_id":"fc8cdf0115d330e6f14a884dc6b42157b5f692e9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f0b2bec5155fa3fc4ddf16e9b6bb8aaeb7eeb30c","unresolved":false,"context_lines":[{"line_number":25,"context_line":"\"\"\")"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"quota_opts \u003d ["},{"line_number":28,"context_line":"    cfg.BoolOpt(\u0027use_oslo_limit\u0027,"},{"line_number":29,"context_line":"        default\u003dFalse,"},{"line_number":30,"context_line":"        help\u003d\"\"\""},{"line_number":31,"context_line":"When true, oslo.limit is used to enforce quotas in Nova via oslo_limit,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_f2e6baaf","line":28,"updated":"2018-11-05 11:39:46.000000000","message":"Maybe enforce_unified_limits is better here. That is more likely to be long lived.","commit_id":"15706149ee69d7d108df38c2d802d5e17f65aa9c"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"70493946e2fae54bd42f0fe2a539d88414c0e2df","unresolved":false,"context_lines":[{"line_number":309,"context_line":"        deprecated_since\u003d\u002719.0.0\u0027,"},{"line_number":310,"context_line":"        deprecated_reason\u003d\"\"\""},{"line_number":311,"context_line":"When using oslo.limit this has no meaning, the default is in Keystone."},{"line_number":312,"context_line":"TODO: is this even used now?\"\"\","},{"line_number":313,"context_line":"        min\u003d0,"},{"line_number":314,"context_line":"        default\u003d0,"},{"line_number":315,"context_line":"        deprecated_group\u003d\u0027DEFAULT\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_9a89541f","line":312,"range":{"start_line":312,"start_character":2,"end_line":312,"end_character":3},"updated":"2018-11-08 10:31:00.000000000","message":"don\u0027t find any usage about the above three confs except in unittest","commit_id":"900413d7c228ce0f59f5b4de96a1b28b212c4503"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7b69261f78a828383e0a9c39d80ac65b0c4a8e3e","unresolved":false,"context_lines":[{"line_number":279,"context_line":"        deprecated_for_removal\u003dTrue,"},{"line_number":280,"context_line":"        deprecated_since\u003d\u002719.0.0\u0027,"},{"line_number":281,"context_line":"        deprecated_reason\u003d\"\"\""},{"line_number":282,"context_line":"When using oslo.limit this has no meaning, the default is in Keystone.\"\"\","},{"line_number":283,"context_line":"        default\u003d\u0027nova.quota.DbQuotaDriver\u0027,"},{"line_number":284,"context_line":"        choices\u003d["},{"line_number":285,"context_line":"            (\u0027nova.quota.DbQuotaDriver\u0027, \u0027Stores quota limit information \u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fa7e38b_8b76753f","line":282,"updated":"2019-11-27 23:01:06.000000000","message":"I guess I wonder, what about the NoopQuotaDriver? If users can\u0027t select a driver, what\u0027s gonna be the lightweight way to go quotaless, if a deployment doesn\u0027t care about enforcing quotas at all?","commit_id":"f0a8d60275266396603d730c290809f57f8b8b9b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"baf909157b3121131ec43eb8ef817a000fc5ab0d","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        deprecated_for_removal\u003dTrue,"},{"line_number":197,"context_line":"        deprecated_since\u003d\u002719.0.0\u0027,"},{"line_number":198,"context_line":"        deprecated_reason\u003d\"\"\""},{"line_number":199,"context_line":"When using oslo.limit this has no meaning, the default is in Keystone.\"\"\","},{"line_number":200,"context_line":"        default\u003d\u0027nova.quota.DbQuotaDriver\u0027,"},{"line_number":201,"context_line":"        choices\u003d["},{"line_number":202,"context_line":"            (\u0027nova.quota.DbQuotaDriver\u0027, \u0027Stores quota limit information \u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"1fa4df85_339dc665","line":199,"updated":"2020-03-06 23:36:35.000000000","message":"What about the NoopQuotaDriver -- wouldn\u0027t we want to keep the ability for users to choose it? It bypasses quota usage counting, so if a deployment doesn\u0027t care about quotas, performance can be much improved by not needlessly counting resource usage (expensive).","commit_id":"3a1eab633f37a8ccfa9fc3a92f45ccc7098f0be8"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"571b76a600b0b411e74cfa71c6ea27fa425e225c","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        deprecated_for_removal\u003dTrue,"},{"line_number":197,"context_line":"        deprecated_since\u003d\u002719.0.0\u0027,"},{"line_number":198,"context_line":"        deprecated_reason\u003d\"\"\""},{"line_number":199,"context_line":"When using oslo.limit this has no meaning, the default is in Keystone.\"\"\","},{"line_number":200,"context_line":"        default\u003d\u0027nova.quota.DbQuotaDriver\u0027,"},{"line_number":201,"context_line":"        choices\u003d["},{"line_number":202,"context_line":"            (\u0027nova.quota.DbQuotaDriver\u0027, \u0027Stores quota limit information \u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"1fa4df85_4f20cef7","line":199,"in_reply_to":"1fa4df85_339dc665","updated":"2020-03-09 09:25:42.000000000","message":"Yeah, good point. So when you have enforce unified limits \u003d True, I always make this the noop, with the idea we remove that code eventually. I guess in the future we just allow enforce unified limits \u003d false, and you get the same thing (long term).","commit_id":"3a1eab633f37a8ccfa9fc3a92f45ccc7098f0be8"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"46a28033cedd23dd0ae882c7381352b4067e52c3","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        deprecated_for_removal\u003dTrue,"},{"line_number":197,"context_line":"        deprecated_since\u003d\u002719.0.0\u0027,"},{"line_number":198,"context_line":"        deprecated_reason\u003d\"\"\""},{"line_number":199,"context_line":"When using oslo.limit this has no meaning, the default is in Keystone.\"\"\","},{"line_number":200,"context_line":"        default\u003d\u0027nova.quota.DbQuotaDriver\u0027,"},{"line_number":201,"context_line":"        choices\u003d["},{"line_number":202,"context_line":"            (\u0027nova.quota.DbQuotaDriver\u0027, \u0027Stores quota limit information \u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"1fa4df85_8e7c7f72","line":199,"in_reply_to":"1fa4df85_4f20cef7","updated":"2020-03-09 18:50:03.000000000","message":"That sounds cool to me.","commit_id":"3a1eab633f37a8ccfa9fc3a92f45ccc7098f0be8"}],"nova/limit.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"45673edaf5aff436e03f12ff469672aae7a41465","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"# Limits not registered with unified limits but are counted."},{"line_number":42,"context_line":"STATIC_LIMITS \u003d {"},{"line_number":43,"context_line":"    \u0027key_pairs\u0027: (CONF.quota.key_pairs, _keypair_count),"},{"line_number":44,"context_line":"    \u0027server_groups\u0027: (CONF.quota.server_groups, _server_group_count),"},{"line_number":45,"context_line":"    # TODO(johngarbutt) previously counted per user,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_15000069","line":42,"range":{"start_line":42,"start_character":0,"end_line":42,"end_character":13},"updated":"2018-11-05 12:18:59.000000000","message":"Maybe \"global\" rather than \"static\", i.e. no per project.","commit_id":"15706149ee69d7d108df38c2d802d5e17f65aa9c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"45673edaf5aff436e03f12ff469672aae7a41465","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"# Limits registered in unified limits"},{"line_number":61,"context_line":"# TODO(johngarbutt) eventually use placement to count custom resource classes"},{"line_number":62,"context_line":"DYNAMIC_LIMITS \u003d [\"servers\", \"resource:VCPU\", \"resource:MEMORY_MB\"]"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def check_api_limit(**kwargs):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_d5f92882","line":62,"updated":"2018-11-05 12:18:59.000000000","message":"Maybe unified_limits?","commit_id":"15706149ee69d7d108df38c2d802d5e17f65aa9c"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"70493946e2fae54bd42f0fe2a539d88414c0e2df","unresolved":false,"context_lines":[{"line_number":35,"context_line":"def _server_group_members_count(context, server_group_uuid):"},{"line_number":36,"context_line":"    server_group \u003d objects.InstanceGroup"},{"line_number":37,"context_line":"    # TODO(johngarbutt) what to do when server_group_uuid is not found?"},{"line_number":38,"context_line":"    return len(server_group.Members)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"# Limits not registered with unified limits but are counted."}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_3a4da0c4","line":38,"updated":"2018-11-08 10:31:00.000000000","message":"Current server group members support counting by user id, are we going to remove user filter here ?","commit_id":"900413d7c228ce0f59f5b4de96a1b28b212c4503"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"84ff15eec604eaeaabe8ca4bbaa59b62c9540275","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        raise exception.OverQuota(\",\".join(overquota))"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"def check_static_limit(context, limit, scope, additional_resource\u003d0):"},{"line_number":79,"context_line":"    \"\"\"Do count of resources, check if over limit defined in STATIC_LIMITS."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    The scope is specific to the limit type:"},{"line_number":82,"context_line":"    * key_pairs scope is context.user_id"},{"line_number":83,"context_line":"    * server_groups scope is context.project_id"},{"line_number":84,"context_line":"    * server_group_members scope is server_group_uuid"},{"line_number":85,"context_line":"    \"\"\""},{"line_number":86,"context_line":"    if not CONF.use_oslo_limit:"},{"line_number":87,"context_line":"        return"},{"line_number":88,"context_line":"    if limit not in STATIC_LIMITS:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_4cb91114","line":85,"range":{"start_line":78,"start_character":0,"end_line":85,"end_character":7},"updated":"2018-11-05 16:04:31.000000000","message":"This seems like code that could be useful elsewhere, or within other services. I know it\u0027s not dependent on anything in keystone, or unified limits for that matter, but would it be worth migrating this to a more common place in the future?","commit_id":"900413d7c228ce0f59f5b4de96a1b28b212c4503"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"723db1bef5b4e6fede5598287eb369a8c77eacb6","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        raise exception.OverQuota(\",\".join(overquota))"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"def check_static_limit(context, limit, scope, additional_resource\u003d0):"},{"line_number":79,"context_line":"    \"\"\"Do count of resources, check if over limit defined in STATIC_LIMITS."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    The scope is specific to the limit type:"},{"line_number":82,"context_line":"    * key_pairs scope is context.user_id"},{"line_number":83,"context_line":"    * server_groups scope is context.project_id"},{"line_number":84,"context_line":"    * server_group_members scope is server_group_uuid"},{"line_number":85,"context_line":"    \"\"\""},{"line_number":86,"context_line":"    if not CONF.use_oslo_limit:"},{"line_number":87,"context_line":"        return"},{"line_number":88,"context_line":"    if limit not in STATIC_LIMITS:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_f05c5581","line":85,"range":{"start_line":78,"start_character":0,"end_line":85,"end_character":7},"in_reply_to":"3f79a3b5_4cb91114","updated":"2018-11-06 14:04:58.000000000","message":"I wouldn\u0027t be against extracting it if other projects want something similar.\n\nIf this distinction is useful for other projects two, that is probably worth it I guess.","commit_id":"900413d7c228ce0f59f5b4de96a1b28b212c4503"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"70493946e2fae54bd42f0fe2a539d88414c0e2df","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    server_count \u003d len(non_deleted_mappings)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    # TODO(johngarbutt) move this bit to placement eventually"},{"line_number":115,"context_line":"    raw_counts \u003d quota._instances_cores_ram_count(context, project_id)"},{"line_number":116,"context_line":"    raw_proj_counts \u003d raw_counts[\u0027project\u0027]"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    return {"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_acbc1b07","line":115,"updated":"2018-11-08 10:31:00.000000000","message":"could query placement usage api for consumption, seems placement will return all resource usages, you have to pick up requested resources from the result.","commit_id":"900413d7c228ce0f59f5b4de96a1b28b212c4503"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"84ff15eec604eaeaabe8ca4bbaa59b62c9540275","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    return {"},{"line_number":119,"context_line":"      \"servers\": server_count,"},{"line_number":120,"context_line":"      \"resource:VCPU\": raw_proj_counts[\u0027cores\u0027],"},{"line_number":121,"context_line":"      \"resource:MEMORY_MB\": raw_proj_counts[\u0027ram\u0027],"},{"line_number":122,"context_line":"    }"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_0c5a39f4","line":120,"range":{"start_line":120,"start_character":7,"end_line":120,"end_character":20},"updated":"2018-11-05 16:04:31.000000000","message":"Do we expect these names to correspond to resource names in keystone?\n\nI\u0027m just thinking about conventions for resource names that is consistent.","commit_id":"900413d7c228ce0f59f5b4de96a1b28b212c4503"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4078569e22078e646c2cb0f458b2f604d6182eff","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    return {"},{"line_number":119,"context_line":"      \"servers\": server_count,"},{"line_number":120,"context_line":"      \"resource:VCPU\": raw_proj_counts[\u0027cores\u0027],"},{"line_number":121,"context_line":"      \"resource:MEMORY_MB\": raw_proj_counts[\u0027ram\u0027],"},{"line_number":122,"context_line":"    }"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_d0b35998","line":120,"range":{"start_line":120,"start_character":7,"end_line":120,"end_character":20},"in_reply_to":"3f79a3b5_0c5a39f4","updated":"2018-11-06 14:06:29.000000000","message":"Yes, if there is a pattern.\n\nThe convention I went for here is resource:\u003cRESOURCE_CLASS\u003e to make it possible for us to look these up in Placement vs things that are not in placement (currently servers).","commit_id":"900413d7c228ce0f59f5b4de96a1b28b212c4503"},{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"70493946e2fae54bd42f0fe2a539d88414c0e2df","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"def _get_enforcer():"},{"line_number":126,"context_line":"    # TODO(johngarbutt) need to work on this interface!"},{"line_number":127,"context_line":"    from oslo_limit import limit"},{"line_number":128,"context_line":"    return limit.Enforcer(count_dynamic_limits)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_2c36cbb4","line":127,"updated":"2018-11-08 10:31:00.000000000","message":"Is there any problem or concern with using context manager?","commit_id":"900413d7c228ce0f59f5b4de96a1b28b212c4503"}],"nova/limits/keystone.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"11a8ba62331ab9f7e03450a09a046203d6bc9339","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    return _ENFORCER"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def check_limits(context, project_id, instance\u003dNone, flavor\u003dNone):"},{"line_number":99,"context_line":"    \"\"\"Check all registered limits in keystone vs current usage from placement."},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    If an instance is specified we check to see if any limits would be"}],"source_content_type":"text/x-python","patch_set":9,"id":"bfb3d3c7_7b3ed58b","line":98,"updated":"2019-05-28 21:07:43.000000000","message":"I imagine this method signature isn\u0027t going to cover all limit cases for nova. Is the idea that more kwargs get tacked on as this method needs to fill more use cases?","commit_id":"27bca21384fe1ab621205440a298ad19ca6fdf55"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6bd54933e9968800c6376e5bd721ab02d0f26414","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    return _ENFORCER"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def check_limits(context, project_id, instance\u003dNone, flavor\u003dNone):"},{"line_number":99,"context_line":"    \"\"\"Check all registered limits in keystone vs current usage from placement."},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    If an instance is specified we check to see if any limits would be"}],"source_content_type":"text/x-python","patch_set":9,"id":"bfb3d3c7_e791aa48","line":98,"in_reply_to":"bfb3d3c7_7b3ed58b","updated":"2019-05-30 09:05:11.000000000","message":"So this covers everything we have planned.","commit_id":"27bca21384fe1ab621205440a298ad19ca6fdf55"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"838cfb3dcc4d866c1556614560682ecc75cedd2c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    global PLACEMENT_CLIENT"},{"line_number":39,"context_line":"    if not PLACEMENT_CLIENT:"},{"line_number":40,"context_line":"        PLACEMENT_CLIENT \u003d report.SchedulerReportClient()"},{"line_number":41,"context_line":"    resp \u003d PLACEMENT_CLIENT._usages()"},{"line_number":42,"context_line":"    if not resp:"},{"line_number":43,"context_line":"        PLACEMENT_CLIENT._handle_usages_error_from_placement(resp, project_id)"},{"line_number":44,"context_line":"        return {}"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_8efed535","line":41,"range":{"start_line":41,"start_character":28,"end_line":41,"end_character":35},"updated":"2019-11-21 19:22:47.000000000","message":"This is going to need to be a real public method added to SchedulerReportClient.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    global PLACEMENT_CLIENT"},{"line_number":39,"context_line":"    if not PLACEMENT_CLIENT:"},{"line_number":40,"context_line":"        PLACEMENT_CLIENT \u003d report.SchedulerReportClient()"},{"line_number":41,"context_line":"    resp \u003d PLACEMENT_CLIENT._usages()"},{"line_number":42,"context_line":"    if not resp:"},{"line_number":43,"context_line":"        PLACEMENT_CLIENT._handle_usages_error_from_placement(resp, project_id)"},{"line_number":44,"context_line":"        return {}"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_92301609","line":41,"range":{"start_line":41,"start_character":28,"end_line":41,"end_character":35},"in_reply_to":"3fa7e38b_8efed535","updated":"2019-11-25 13:04:42.000000000","message":"yeah, that would be better, I forget what made we do this nonsense.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"838cfb3dcc4d866c1556614560682ecc75cedd2c","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        PLACEMENT_CLIENT \u003d report.SchedulerReportClient()"},{"line_number":41,"context_line":"    resp \u003d PLACEMENT_CLIENT._usages()"},{"line_number":42,"context_line":"    if not resp:"},{"line_number":43,"context_line":"        PLACEMENT_CLIENT._handle_usages_error_from_placement(resp, project_id)"},{"line_number":44,"context_line":"        return {}"},{"line_number":45,"context_line":"    data \u003d resp.json()"},{"line_number":46,"context_line":"    return data[\u0027usages\u0027]"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_ce6b6ded","line":43,"updated":"2019-11-21 19:22:47.000000000","message":"Note that this error handling stuff should go in SchedulerReportClient with the new method ^.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        PLACEMENT_CLIENT \u003d report.SchedulerReportClient()"},{"line_number":41,"context_line":"    resp \u003d PLACEMENT_CLIENT._usages()"},{"line_number":42,"context_line":"    if not resp:"},{"line_number":43,"context_line":"        PLACEMENT_CLIENT._handle_usages_error_from_placement(resp, project_id)"},{"line_number":44,"context_line":"        return {}"},{"line_number":45,"context_line":"    data \u003d resp.json()"},{"line_number":46,"context_line":"    return data[\u0027usages\u0027]"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_7239daee","line":43,"in_reply_to":"3fa7e38b_ce6b6ded","updated":"2019-11-25 13:04:42.000000000","message":"++","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"838cfb3dcc4d866c1556614560682ecc75cedd2c","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    resp \u003d PLACEMENT_CLIENT._usages()"},{"line_number":42,"context_line":"    if not resp:"},{"line_number":43,"context_line":"        PLACEMENT_CLIENT._handle_usages_error_from_placement(resp, project_id)"},{"line_number":44,"context_line":"        return {}"},{"line_number":45,"context_line":"    data \u003d resp.json()"},{"line_number":46,"context_line":"    return data[\u0027usages\u0027]"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_4e89bdc4","line":44,"range":{"start_line":44,"start_character":8,"end_line":44,"end_character":17},"updated":"2019-11-21 19:22:47.000000000","message":"Caution here, need to make sure we check \"if usages\" if we do this. (I see we\u0027re doing usages.get() which works).","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    resp \u003d PLACEMENT_CLIENT._usages()"},{"line_number":42,"context_line":"    if not resp:"},{"line_number":43,"context_line":"        PLACEMENT_CLIENT._handle_usages_error_from_placement(resp, project_id)"},{"line_number":44,"context_line":"        return {}"},{"line_number":45,"context_line":"    data \u003d resp.json()"},{"line_number":46,"context_line":"    return data[\u0027usages\u0027]"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_b233d212","line":44,"range":{"start_line":44,"start_character":8,"end_line":44,"end_character":17},"in_reply_to":"3fa7e38b_4e89bdc4","updated":"2019-11-25 13:04:42.000000000","message":"yeah, probably safter just to raise here, its not expected.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"838cfb3dcc4d866c1556614560682ecc75cedd2c","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def _count_dynamic_limits(context, project_id, resource_names):"},{"line_number":50,"context_line":"    \"\"\"Called by os.limits enforcer\"\"\""},{"line_number":51,"context_line":"    if not CONF.quota.use_oslo_limit:"},{"line_number":52,"context_line":"        raise Exception(\"oslo_limit checking is disabled\")"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    count_servers \u003d False"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_4e88dd69","line":51,"range":{"start_line":51,"start_character":22,"end_line":51,"end_character":36},"updated":"2019-11-21 19:22:47.000000000","message":"I dunno why but I expected the conf option would be something like use_unified_limits (from the end user perspective).","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def _count_dynamic_limits(context, project_id, resource_names):"},{"line_number":50,"context_line":"    \"\"\"Called by os.limits enforcer\"\"\""},{"line_number":51,"context_line":"    if not CONF.quota.use_oslo_limit:"},{"line_number":52,"context_line":"        raise Exception(\"oslo_limit checking is disabled\")"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    count_servers \u003d False"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_f224eac4","line":51,"range":{"start_line":51,"start_character":22,"end_line":51,"end_character":36},"in_reply_to":"3fa7e38b_4e88dd69","updated":"2019-11-25 13:04:42.000000000","message":"hmm, yeah, that sounds much better actually.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"838cfb3dcc4d866c1556614560682ecc75cedd2c","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        elif resource.startswith(\"class:\"):"},{"line_number":61,"context_line":"            r_class \u003d resource.lstrip(\"class:\")"},{"line_number":62,"context_line":"            if r_class in orc.STANDARDS or orc.is_custom(r_class):"},{"line_number":63,"context_line":"                resource_names.append()"},{"line_number":64,"context_line":"            else:"},{"line_number":65,"context_line":"                raise Exception(\"Unknown resource class: %s\" % resource)"},{"line_number":66,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_8e6ed593","line":63,"range":{"start_line":63,"start_character":16,"end_line":63,"end_character":39},"updated":"2019-11-21 19:22:47.000000000","message":"resource_classes.append(r_class) right?","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        elif resource.startswith(\"class:\"):"},{"line_number":61,"context_line":"            r_class \u003d resource.lstrip(\"class:\")"},{"line_number":62,"context_line":"            if r_class in orc.STANDARDS or orc.is_custom(r_class):"},{"line_number":63,"context_line":"                resource_names.append()"},{"line_number":64,"context_line":"            else:"},{"line_number":65,"context_line":"                raise Exception(\"Unknown resource class: %s\" % resource)"},{"line_number":66,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_9219f688","line":63,"range":{"start_line":63,"start_character":16,"end_line":63,"end_character":39},"in_reply_to":"3fa7e38b_8e6ed593","updated":"2019-11-25 13:04:42.000000000","message":"hmm, oops.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"838cfb3dcc4d866c1556614560682ecc75cedd2c","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            if r_class in orc.STANDARDS or orc.is_custom(r_class):"},{"line_number":63,"context_line":"                resource_names.append()"},{"line_number":64,"context_line":"            else:"},{"line_number":65,"context_line":"                raise Exception(\"Unknown resource class: %s\" % resource)"},{"line_number":66,"context_line":"        else:"},{"line_number":67,"context_line":"            raise Exception(\"Unknown resource type: %s\" % resource)"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_4e645db3","line":65,"range":{"start_line":65,"start_character":63,"end_line":65,"end_character":71},"updated":"2019-11-21 19:22:47.000000000","message":"r_class?","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            if r_class in orc.STANDARDS or orc.is_custom(r_class):"},{"line_number":63,"context_line":"                resource_names.append()"},{"line_number":64,"context_line":"            else:"},{"line_number":65,"context_line":"                raise Exception(\"Unknown resource class: %s\" % resource)"},{"line_number":66,"context_line":"        else:"},{"line_number":67,"context_line":"            raise Exception(\"Unknown resource type: %s\" % resource)"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_520ffe37","line":65,"range":{"start_line":65,"start_character":63,"end_line":65,"end_character":71},"in_reply_to":"3fa7e38b_4e645db3","updated":"2019-11-25 13:04:42.000000000","message":"clearly, more testing needed here (facepalm)","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"838cfb3dcc4d866c1556614560682ecc75cedd2c","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    if not CONF.quota.use_oslo_limit:"},{"line_number":112,"context_line":"        return"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    # default to checking all limits"},{"line_number":115,"context_line":"    deltas \u003d None"},{"line_number":116,"context_line":"    if instance is not None and flavor is not None:"},{"line_number":117,"context_line":"        # doing a resize"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_4e6d3d2d","line":114,"range":{"start_line":114,"start_character":17,"end_line":114,"end_character":36},"updated":"2019-11-21 19:22:47.000000000","message":"Is this just one REST call to keystone or N (limits)? If it\u0027s N, I think we should have a way to only grab the limits we need. Though, as I say that, I think implementing a batch call in keystone would be better actually.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6ba4981b268f76dd2b47f43aed310a5f6699e2d7","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    if not CONF.quota.use_oslo_limit:"},{"line_number":112,"context_line":"        return"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    # default to checking all limits"},{"line_number":115,"context_line":"    deltas \u003d None"},{"line_number":116,"context_line":"    if instance is not None and flavor is not None:"},{"line_number":117,"context_line":"        # doing a resize"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_ec872d5a","line":114,"range":{"start_line":114,"start_character":17,"end_line":114,"end_character":36},"in_reply_to":"3fa7e38b_153bb0d0","updated":"2019-11-25 17:05:34.000000000","message":"I saw the new oslo.limit patches but didn\u0027t dig in deeper for review yet. It\u0027s on my TODO list.\n\nI\u0027m not sure I\u0027m 100% following your example here but in general I agree that we only want to check limits related to the instance or action the user is trying to carry out.\n\nI\u0027m also realizing that multiple keystone calls can be made fast by doing them in parallel, so in that regard maybe a batch ability is not needed.\n\nTo be clear, what I was thinking originally was, one batch call to keystone for all limits for a project and then on the client side only selectively use the ones related to the request. But now, with the idea of parallel requests to keystone in mind for multiple limits, we could just have them be separate calls and do them in parallel, only for the limits related to the request at hand.\n\nHopefully what I said makes sense.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    if not CONF.quota.use_oslo_limit:"},{"line_number":112,"context_line":"        return"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    # default to checking all limits"},{"line_number":115,"context_line":"    deltas \u003d None"},{"line_number":116,"context_line":"    if instance is not None and flavor is not None:"},{"line_number":117,"context_line":"        # doing a resize"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_153bb0d0","line":114,"range":{"start_line":114,"start_character":17,"end_line":114,"end_character":36},"in_reply_to":"3fa7e38b_4e6d3d2d","updated":"2019-11-25 13:04:42.000000000","message":"I have the oslo.limit stuff up for review now (its actually lots of calls to keystone right now):\nhttps://review.opendev.org/#/c/695310\n\nSo... I think this is a bad idea now actually... because you can have an over limit error that is unrelated to the instance or action you are checking about. For example, if you reduce ironic quotas, then all your VMs will stop being created till you delete your ironic instances. Now someone may want that behviour, but that is very different to the current system, where its about if any of the resources this instance is claiming are needed.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7b69261f78a828383e0a9c39d80ac65b0c4a8e3e","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        mappings \u003d objects.InstanceMappingList.get_counts(context, project_id)"},{"line_number":76,"context_line":"        resource_counts[\u0027servers\u0027] \u003d mappings[\u0027project\u0027][\u0027instances\u0027]"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    usages \u003d _get_placement_usages(context, project_id)"},{"line_number":79,"context_line":"    for resource_class in resource_classes:"},{"line_number":80,"context_line":"        # Placement doesn\u0027t know about classes with zero usage"},{"line_number":81,"context_line":"        # so default to zero to tell oslo.limit usage is zero"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fa7e38b_eb8a8911","line":78,"updated":"2019-11-27 23:01:06.000000000","message":"Note to self: one call to placement to get all usages.","commit_id":"f0a8d60275266396603d730c290809f57f8b8b9b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7b69261f78a828383e0a9c39d80ac65b0c4a8e3e","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    enforcer \u003d limit.Enforcer(callback)"},{"line_number":122,"context_line":"    deltas \u003d _get_deltas_by_flavor(flavor, max_count)"},{"line_number":123,"context_line":"    try:"},{"line_number":124,"context_line":"        enforcer.enforce(project_id, deltas)"},{"line_number":125,"context_line":"    except limit_exceptions.ProjectOverLimit as e:"},{"line_number":126,"context_line":"        if max_count \u003c\u003d min_count:"},{"line_number":127,"context_line":"            overs \u003d {}"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fa7e38b_cb99cd6d","line":124,"updated":"2019-11-27 23:01:06.000000000","message":"Note to self: this will call keystone N deltas times sequentially and call placement once to get all usages in a batch.","commit_id":"f0a8d60275266396603d730c290809f57f8b8b9b"}],"nova/limits/local.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"11a8ba62331ab9f7e03450a09a046203d6bc9339","unresolved":false,"context_lines":[{"line_number":64,"context_line":"}"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def check_delta(context, entity_type, entity_scope, delta):"},{"line_number":68,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    Firstly we count the current usage given the specified scope."}],"source_content_type":"text/x-python","patch_set":9,"id":"bfb3d3c7_5bf751d4","line":67,"range":{"start_line":67,"start_character":4,"end_line":67,"end_character":15},"updated":"2019-05-28 21:07:43.000000000","message":"I\u0027m trying to figure out what we mean by delta. Do we mean the difference between available limits and current usage? Or do we mean the resources the user is trying to claim?","commit_id":"27bca21384fe1ab621205440a298ad19ca6fdf55"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4c19c51d11d5598aef0c4ec98e2cd2109fa5f4ef","unresolved":false,"context_lines":[{"line_number":64,"context_line":"}"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def check_delta(context, entity_type, entity_scope, delta):"},{"line_number":68,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    Firstly we count the current usage given the specified scope."}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_86cd5286","line":67,"range":{"start_line":67,"start_character":4,"end_line":67,"end_character":15},"in_reply_to":"9fb8cfa7_5fc89372","updated":"2019-06-14 12:39:12.000000000","message":"Yeah, I think so.\n\nWe probably call usage counts now.\n\nHistorically we used to store the claims/reservations in the DB, and we moved to counting.","commit_id":"27bca21384fe1ab621205440a298ad19ca6fdf55"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"53dbe6f674cc287bda77f26cb7a35f6fe17b6bf0","unresolved":false,"context_lines":[{"line_number":64,"context_line":"}"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def check_delta(context, entity_type, entity_scope, delta):"},{"line_number":68,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    Firstly we count the current usage given the specified scope."}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_5fc89372","line":67,"range":{"start_line":67,"start_character":4,"end_line":67,"end_character":15},"in_reply_to":"bfb3d3c7_47bf56a9","updated":"2019-06-12 13:58:02.000000000","message":"Got it, that makes sense. I liked the terminology sdague used when we first start working on this.\n\nlimit \u003d\u003d an integer representing the upper bound of a resource you can consume\nusage \u003d\u003d the number of resources you currently have\nclaim \u003d\u003d the number of resources you\u0027re trying to obtain in a request\n\nIn the historical implementation, it sounds like:\n\nlimit \u003d\u003d quota\nusage \u003d\u003d quota (in a way because quotas handled both, right?)\nclaim \u003d\u003d delta\n\n?","commit_id":"27bca21384fe1ab621205440a298ad19ca6fdf55"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6bd54933e9968800c6376e5bd721ab02d0f26414","unresolved":false,"context_lines":[{"line_number":64,"context_line":"}"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def check_delta(context, entity_type, entity_scope, delta):"},{"line_number":68,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    Firstly we count the current usage given the specified scope."}],"source_content_type":"text/x-python","patch_set":9,"id":"bfb3d3c7_47bf56a9","line":67,"range":{"start_line":67,"start_character":4,"end_line":67,"end_character":15},"in_reply_to":"bfb3d3c7_5bf751d4","updated":"2019-05-30 09:05:11.000000000","message":"good point, its a historic name. It means \"additional\" usage we want to check.\n\nHistorically we used to do negatives in certain cases (resize down). Probably needs a better name, like additional_usage.","commit_id":"27bca21384fe1ab621205440a298ad19ca6fdf55"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"dce8a988d0b04fd4d46ceab73a19219304de046a","unresolved":false,"context_lines":[{"line_number":33,"context_line":"INJECTED_FILES_CONTENT \u003d \"injected_file_content_bytes\""},{"line_number":34,"context_line":"INJECTED_FILES_PATH \u003d \"injected_file_path_bytes\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"COUNT_LIMITS \u003d {"},{"line_number":37,"context_line":"    SERVER_METADATA_ITEMS: \"metadata_items\","},{"line_number":38,"context_line":"    INJECTED_FILES: \"injected_files\","},{"line_number":39,"context_line":"    INJECTED_FILES_CONTENT: \"injected_file_content_bytes\","}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_a8a3889a","line":36,"range":{"start_line":36,"start_character":0,"end_line":36,"end_character":12},"updated":"2019-11-21 18:05:33.000000000","message":"This is a bit confusing when considered alongside COUNTABLE_ENTITIES. I understand COUNTABLE_ENTITIES to be things that we can count locally in our database.\n\nCOUNT_LIMITS are not the same though (no counting of database items). But they\u0027re named so similarly. That said, I can\u0027t think of a better name at the moment. Just something to think about.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6ba4981b268f76dd2b47f43aed310a5f6699e2d7","unresolved":false,"context_lines":[{"line_number":33,"context_line":"INJECTED_FILES_CONTENT \u003d \"injected_file_content_bytes\""},{"line_number":34,"context_line":"INJECTED_FILES_PATH \u003d \"injected_file_path_bytes\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"COUNT_LIMITS \u003d {"},{"line_number":37,"context_line":"    SERVER_METADATA_ITEMS: \"metadata_items\","},{"line_number":38,"context_line":"    INJECTED_FILES: \"injected_files\","},{"line_number":39,"context_line":"    INJECTED_FILES_CONTENT: \"injected_file_content_bytes\","}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_814be284","line":36,"range":{"start_line":36,"start_character":0,"end_line":36,"end_character":12},"in_reply_to":"3fa7e38b_15409034","updated":"2019-11-25 17:05:34.000000000","message":"The more I think about the original names \"count limits\" vs \"countable entities\" the more they make sense to me. So now I\u0027m not feeling confident about different naming being needed.\n\nBut, I think API_REQUEST_LIMITS might be closer. I was trying to work out what these limits actually are. They are limits where if the user asks for more than N of these things, we reject them. And it seems like API_REQUEST_LIMITS would capture that meaning a bit better.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":33,"context_line":"INJECTED_FILES_CONTENT \u003d \"injected_file_content_bytes\""},{"line_number":34,"context_line":"INJECTED_FILES_PATH \u003d \"injected_file_path_bytes\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"COUNT_LIMITS \u003d {"},{"line_number":37,"context_line":"    SERVER_METADATA_ITEMS: \"metadata_items\","},{"line_number":38,"context_line":"    INJECTED_FILES: \"injected_files\","},{"line_number":39,"context_line":"    INJECTED_FILES_CONTENT: \"injected_file_content_bytes\","}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_15409034","line":36,"range":{"start_line":36,"start_character":0,"end_line":36,"end_character":12},"in_reply_to":"3fa7e38b_a8a3889a","updated":"2019-11-25 13:04:42.000000000","message":"Good point... I did try to add API into there, to make it clear its related to the API request.\n\nMaybe API_REQUEST_LIMITS might be better.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"dce8a988d0b04fd4d46ceab73a19219304de046a","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def _server_group_members_count(context, server_group_uuid):"},{"line_number":54,"context_line":"    # NOTE(johngarbutt) we used to count members added per user"},{"line_number":55,"context_line":"    server_group \u003d objects.InstanceGroup.get_by_uuid(context,"},{"line_number":56,"context_line":"                                                     server_group_uuid)"},{"line_number":57,"context_line":"    return len(server_group.Members)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_08a73cbe","line":54,"updated":"2019-11-21 18:05:33.000000000","message":"Thanks for noting this.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"dce8a988d0b04fd4d46ceab73a19219304de046a","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    # NOTE(johngarbutt) we used to count members added per user"},{"line_number":55,"context_line":"    server_group \u003d objects.InstanceGroup.get_by_uuid(context,"},{"line_number":56,"context_line":"                                                     server_group_uuid)"},{"line_number":57,"context_line":"    return len(server_group.Members)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"COUNTABLE_ENTITIES \u003d {"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_c894c446","line":57,"range":{"start_line":57,"start_character":28,"end_line":57,"end_character":35},"updated":"2019-11-21 18:05:33.000000000","message":"members","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    return len(server_group.Members)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"COUNTABLE_ENTITIES \u003d {"},{"line_number":61,"context_line":"    KEY_PAIRS: (CONF.quota.key_pairs, _keypair_count),"},{"line_number":62,"context_line":"    SERVER_GROUPS: (CONF.quota.server_groups, _server_group_count),"},{"line_number":63,"context_line":"    SERVER_GROUP_MEMBERS: (CONF.quota.server_group_members,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_353b4cc8","line":60,"updated":"2019-11-25 13:04:42.000000000","message":"Tempted by DB_COUNTABLE_ENTITIES here.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6ba4981b268f76dd2b47f43aed310a5f6699e2d7","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    return len(server_group.Members)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"COUNTABLE_ENTITIES \u003d {"},{"line_number":61,"context_line":"    KEY_PAIRS: (CONF.quota.key_pairs, _keypair_count),"},{"line_number":62,"context_line":"    SERVER_GROUPS: (CONF.quota.server_groups, _server_group_count),"},{"line_number":63,"context_line":"    SERVER_GROUP_MEMBERS: (CONF.quota.server_group_members,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_41364a04","line":60,"in_reply_to":"3fa7e38b_353b4cc8","updated":"2019-11-25 17:05:34.000000000","message":"FWIW I don\u0027t think this one is confusing as-is, it was COUNT_LIMITS that threw me. I\u0027m neutral about changing it.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":65,"context_line":"}"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"def check_delta(context, entity_type, entity_scope, delta):"},{"line_number":69,"context_line":"    \"\"\"Check provided delta does not put resource over limit."},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    Firstly we count the current usage given the specified scope."}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_9575609a","line":68,"updated":"2019-11-25 13:04:42.000000000","message":"check_db_limit?","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    * server_group_members scope is server_group_uuid"},{"line_number":83,"context_line":"    \"\"\""},{"line_number":84,"context_line":"    if not CONF.quota.use_oslo_limit:"},{"line_number":85,"context_line":"        return"},{"line_number":86,"context_line":"    if entity_type not in COUNTABLE_ENTITIES:"},{"line_number":87,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":88,"context_line":"    if int(delta) \u003c\u003d 0:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_f52b7478","line":85,"updated":"2019-11-25 13:04:42.000000000","message":"This is what I meant about not needing the if/else everywhere.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6ba4981b268f76dd2b47f43aed310a5f6699e2d7","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    * server_group_members scope is server_group_uuid"},{"line_number":83,"context_line":"    \"\"\""},{"line_number":84,"context_line":"    if not CONF.quota.use_oslo_limit:"},{"line_number":85,"context_line":"        return"},{"line_number":86,"context_line":"    if entity_type not in COUNTABLE_ENTITIES:"},{"line_number":87,"context_line":"        raise ValueError(\"entity_type\")"},{"line_number":88,"context_line":"    if int(delta) \u003c\u003d 0:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_e13e5624","line":85,"in_reply_to":"3fa7e38b_f52b7478","updated":"2019-11-25 17:05:34.000000000","message":"Oh, thanks for pointing this out. I missed the connection for some reason.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2106db0f06e7f8acba6db19764be6990616a354d","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                                  quotas\u003d{entity_type: limit})"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"def check_count(entity_type, count):"},{"line_number":100,"context_line":"    \"\"\"Check if the values given are over the limit for that key."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    This is generally used for limiting the size of certain API requests"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_d5451845","line":99,"updated":"2019-11-25 13:04:42.000000000","message":"check_api_request_limit ?","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6ba4981b268f76dd2b47f43aed310a5f6699e2d7","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                                  quotas\u003d{entity_type: limit})"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"def check_count(entity_type, count):"},{"line_number":100,"context_line":"    \"\"\"Check if the values given are over the limit for that key."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    This is generally used for limiting the size of certain API requests"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_410f2a38","line":99,"in_reply_to":"3fa7e38b_d5451845","updated":"2019-11-25 17:05:34.000000000","message":"I must admit I like the proposed new names for the limit check methods because of the symmetry and making it a bit more obvious what\u0027s happening.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"}],"nova/network/manager.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"11a8ba62331ab9f7e03450a09a046203d6bc9339","unresolved":false,"context_lines":[{"line_number":817,"context_line":"        quota_project, quota_user \u003d quotas_obj.ids_from_instance(context,"},{"line_number":818,"context_line":"                                                                 instance)"},{"line_number":819,"context_line":"        try:"},{"line_number":820,"context_line":"            quotas.check_deltas(context, {\u0027fixed_ips\u0027: 1}, quota_project)"},{"line_number":821,"context_line":"            # NOTE(johngarbutt) not moved to unified limits"},{"line_number":822,"context_line":"        except exception.OverQuota as exc:"},{"line_number":823,"context_line":"            count \u003d exc.kwargs[\u0027usages\u0027][\u0027fixed_ips\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"bfb3d3c7_1beb19dc","line":820,"range":{"start_line":820,"start_character":19,"end_line":820,"end_character":31},"updated":"2019-05-28 21:07:43.000000000","message":"Ah - it looks like \u0027deltas\u0027 is just a term from the quota implementation?","commit_id":"27bca21384fe1ab621205440a298ad19ca6fdf55"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6bd54933e9968800c6376e5bd721ab02d0f26414","unresolved":false,"context_lines":[{"line_number":817,"context_line":"        quota_project, quota_user \u003d quotas_obj.ids_from_instance(context,"},{"line_number":818,"context_line":"                                                                 instance)"},{"line_number":819,"context_line":"        try:"},{"line_number":820,"context_line":"            quotas.check_deltas(context, {\u0027fixed_ips\u0027: 1}, quota_project)"},{"line_number":821,"context_line":"            # NOTE(johngarbutt) not moved to unified limits"},{"line_number":822,"context_line":"        except exception.OverQuota as exc:"},{"line_number":823,"context_line":"            count \u003d exc.kwargs[\u0027usages\u0027][\u0027fixed_ips\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"bfb3d3c7_e7df6a0a","line":820,"range":{"start_line":820,"start_character":19,"end_line":820,"end_character":31},"in_reply_to":"bfb3d3c7_1beb19dc","updated":"2019-05-30 09:05:11.000000000","message":"yeah, its \"historic\", doesn\u0027t make it good :)","commit_id":"27bca21384fe1ab621205440a298ad19ca6fdf55"}],"nova/quota.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ab89dceda103ffddcca912435f289bdd328b3859","unresolved":false,"context_lines":[{"line_number":886,"context_line":"    def _driver(self):"},{"line_number":887,"context_line":"        if self.__driver:"},{"line_number":888,"context_line":"            return self.__driver"},{"line_number":889,"context_line":"        if CONF.quota.use_oslo_limit:"},{"line_number":890,"context_line":"            self.__driver \u003d importutils.import_object("},{"line_number":891,"context_line":"                    \u0027nova.quota.NoopQuotaDriver\u0027)"},{"line_number":892,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_959a40c2","line":889,"updated":"2019-11-25 13:05:54.000000000","message":"This is the other half of the trick to avoid if/else blocks at all the call sites.","commit_id":"7a63e827500c0fce6f41eec34a12cae5843eaa90"}]}
