)]}'
{"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f5d5bcadcb6c2f7520c6a26d47f4d78b5c77c8af","unresolved":false,"context_lines":[{"line_number":3508,"context_line":"    for res, delta in deltas.items():"},{"line_number":3509,"context_line":"        # We can\u0027t go over-quota if we\u0027re not reserving anything or if"},{"line_number":3510,"context_line":"        # we have unlimited quotas."},{"line_number":3511,"context_line":"        if user_quotas[res] \u003e\u003d 0 and delta \u003e\u003d 0:"},{"line_number":3512,"context_line":"            # over if the project usage + delta is more than project quota"},{"line_number":3513,"context_line":"            if project_quotas[res] \u003c delta + project_usages[res][\u0027total\u0027]:"},{"line_number":3514,"context_line":"                LOG.debug(\u0027Request is over project quota for resource \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"da85f559_848ff473","side":"PARENT","line":3511,"updated":"2015-11-12 12:27:30.000000000","message":"why not just add project_quotas[res]\u003e\u003d0 here?","commit_id":"fd2e946b62fdb2aadda885c16a18fb49173d37d5"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"87ab9baae20e6faee921fc3b974433d11f4380f6","unresolved":false,"context_lines":[{"line_number":3508,"context_line":"    for res, delta in deltas.items():"},{"line_number":3509,"context_line":"        # We can\u0027t go over-quota if we\u0027re not reserving anything or if"},{"line_number":3510,"context_line":"        # we have unlimited quotas."},{"line_number":3511,"context_line":"        if user_quotas[res] \u003e\u003d 0 and delta \u003e\u003d 0:"},{"line_number":3512,"context_line":"            # over if the project usage + delta is more than project quota"},{"line_number":3513,"context_line":"            if project_quotas[res] \u003c delta + project_usages[res][\u0027total\u0027]:"},{"line_number":3514,"context_line":"                LOG.debug(\u0027Request is over project quota for resource \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_cce307d8","side":"PARENT","line":3511,"in_reply_to":"da85f559_6e26ef69","updated":"2015-11-19 12:22:56.000000000","message":"ah, sorry, I see now, that makes sense.","commit_id":"fd2e946b62fdb2aadda885c16a18fb49173d37d5"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"e745769ea8516b28cd144b2931922dbd4b665af5","unresolved":false,"context_lines":[{"line_number":3508,"context_line":"    for res, delta in deltas.items():"},{"line_number":3509,"context_line":"        # We can\u0027t go over-quota if we\u0027re not reserving anything or if"},{"line_number":3510,"context_line":"        # we have unlimited quotas."},{"line_number":3511,"context_line":"        if user_quotas[res] \u003e\u003d 0 and delta \u003e\u003d 0:"},{"line_number":3512,"context_line":"            # over if the project usage + delta is more than project quota"},{"line_number":3513,"context_line":"            if project_quotas[res] \u003c delta + project_usages[res][\u0027total\u0027]:"},{"line_number":3514,"context_line":"                LOG.debug(\u0027Request is over project quota for resource \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"da85f559_6e26ef69","side":"PARENT","line":3511,"in_reply_to":"da85f559_848ff473","updated":"2015-11-16 07:43:58.000000000","message":"We need to handle the case that project quota is unlimited and user_quota is regular , like: project_quota \u003d\u003d -1(unlimited), user_quota \u003d\u003d 1, so if just add project_quotas[res]\u003e\u003d0, that can\u0027t handle the case that user_quota is overfill.","commit_id":"fd2e946b62fdb2aadda885c16a18fb49173d37d5"}],"nova/tests/unit/db/test_db_api.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"87ab9baae20e6faee921fc3b974433d11f4380f6","unresolved":false,"context_lines":[{"line_number":6906,"context_line":""},{"line_number":6907,"context_line":"    def test_calculate_overquota_unlimited_project_quota(self):"},{"line_number":6908,"context_line":"        deltas \u003d {\u0027foo\u0027: 1}"},{"line_number":6909,"context_line":"        project_quotas \u003d {\u0027foo\u0027: -1}"},{"line_number":6910,"context_line":"        user_quotas \u003d {\u0027foo\u0027: 1}"},{"line_number":6911,"context_line":"        project_usages \u003d {\u0027foo\u0027: {\u0027total\u0027: 0}}"},{"line_number":6912,"context_line":"        user_usages \u003d {\u0027foo\u0027: {\u0027total\u0027: 0}}"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_6cd0dbc9","line":6909,"updated":"2015-11-19 12:22:56.000000000","message":"I do wonder if we need a test were project is unlimited, but the user is over their quota, to make sure that still fails? Looking at the code, I think we are fine, but I am curious if we are missing tests here.","commit_id":"b630d1471b9f7efc0949fcd8042e86641a997762"}]}
