)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     He Jie Xu \u003cxuhj@linux.vnet.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-02-26 09:16:03 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Wrap quota controller with resource.Resource"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Fixes bug 1116137"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAANH%2F%2F%2Ffc%3D","line":7,"updated":"2013-02-28 05:22:40.000000000","message":"it seems like this change does more than that, in particular, fixing some issues where we were not properly checking permissions on quota calls.  Would be good to have a more detailed commit message.  \n\nalso, good to explain why wrapping quota controller is necessary.","commit_id":"56cf9bea6fe87b099c29d09f42ab9f9cfc2c2362"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     He Jie Xu \u003cxuhj@linux.vnet.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-02-26 09:16:03 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Wrap quota controller with resource.Resource"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Fixes bug 1116137"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAANH%2F%2F%2FcM%3D","line":7,"in_reply_to":"AAAANH%2F%2F%2Ffc%3D","updated":"2013-02-28 07:45:30.000000000","message":"Done","commit_id":"56cf9bea6fe87b099c29d09f42ab9f9cfc2c2362"}],"quantum/common/exceptions.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"class QuotaInvalidTenant(BadRequest):"},{"line_number":232,"context_line":"    message \u003d _(\"Invalid tenant: %(tenant_id)s\")"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"class InvalidQuotaValue(Conflict):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BslM%3D","line":232,"updated":"2013-02-21 10:41:41.000000000","message":"Can you add a unit test where this exception is raised?\nYou have a unit test for a 403, but not one for this one, which would raise a 400.","commit_id":"49b3ef828eb008934f4e42156d2f825862ade1c8"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"class QuotaInvalidTenant(BadRequest):"},{"line_number":232,"context_line":"    message \u003d _(\"Invalid tenant: %(tenant_id)s\")"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"class InvalidQuotaValue(Conflict):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Bq04%3D","line":232,"in_reply_to":"AAAAM3%2F%2BslM%3D","updated":"2013-02-22 03:22:32.000000000","message":"Done","commit_id":"49b3ef828eb008934f4e42156d2f825862ade1c8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"class QuotaNoTenantFromRequestContext(BadRequest):"},{"line_number":232,"context_line":"    message \u003d _(\"Didn\u0027t find tenant from request context\")"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"class InvalidQuotaValue(Conflict):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAM3%2F%2Bni4%3D","line":232,"updated":"2013-02-25 17:49:10.000000000","message":"Consider \"Tenant not found\" or \"Invalid tenant\"\nNot sure that the user is aware of the request context","commit_id":"c41d17fc5c6f8b66ba9c6aa2acc72fef8e64ab84"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"class QuotaNoTenantFromRequestContext(BadRequest):"},{"line_number":232,"context_line":"    message \u003d _(\"Didn\u0027t find tenant from request context\")"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"class InvalidQuotaValue(Conflict):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAM3%2F%2Bmus%3D","line":232,"in_reply_to":"AAAAM3%2F%2Bni4%3D","updated":"2013-02-26 01:15:22.000000000","message":"Choose \u0027Tenant not found\u0027","commit_id":"c41d17fc5c6f8b66ba9c6aa2acc72fef8e64ab84"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"class QuotaTenantNotFound(BadRequest):"},{"line_number":232,"context_line":"    message \u003d _(\"Tenant not found\")"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"class InvalidQuotaValue(Conflict):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAANH%2F%2F%2FgE%3D","line":232,"updated":"2013-02-28 05:22:40.000000000","message":"presumably this should include the tenant-id in the message.","commit_id":"56cf9bea6fe87b099c29d09f42ab9f9cfc2c2362"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"class QuotaTenantNotFound(BadRequest):"},{"line_number":232,"context_line":"    message \u003d _(\"Tenant not found\")"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"class InvalidQuotaValue(Conflict):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAANH%2F%2F%2Fbk%3D","line":232,"in_reply_to":"AAAANH%2F%2F%2FgE%3D","updated":"2013-02-28 07:45:30.000000000","message":"This exception raise when tenant-id \u003d\u003d None from request context. So it needn\u0027t tenant-id.","commit_id":"56cf9bea6fe87b099c29d09f42ab9f9cfc2c2362"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"class QuotaTenantNotFound(BadRequest):"},{"line_number":232,"context_line":"    message \u003d _(\"Tenant not found\")"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"class InvalidQuotaValue(Conflict):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2F%2FrM%3D","line":232,"updated":"2013-03-04 08:46:09.000000000","message":"Sorry to come back to this point.\nBut if the exception is raised when tenant_id\u003d\u003dNone, then \u0027tenant not found\u0027 is not really correct, since you did not have a tenant at all!","commit_id":"61b000328cf9be28dffb7ff0459bd92d40caa263"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"class QuotaTenantNotFound(BadRequest):"},{"line_number":232,"context_line":"    message \u003d _(\"Tenant not found\")"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"class InvalidQuotaValue(Conflict):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2F%2FKc%3D","line":232,"in_reply_to":"AAAAN3%2F%2F%2FLw%3D","updated":"2013-03-04 16:12:13.000000000","message":"Your suggestion would work.\n\nI think you correctly understood my comment, even if it was formulated in a far-from-clear way.","commit_id":"61b000328cf9be28dffb7ff0459bd92d40caa263"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"class QuotaTenantNotFound(BadRequest):"},{"line_number":232,"context_line":"    message \u003d _(\"Tenant not found\")"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"class InvalidQuotaValue(Conflict):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2F%2FLw%3D","line":232,"in_reply_to":"AAAAN3%2F%2F%2FrM%3D","updated":"2013-03-04 16:08:53.000000000","message":"Emm... I probably understand what you said. \u0027Tenant not found\u0027 means I have one but I can\u0027t find it. :)\n\nAs your suggest of  the exception name, How about \u0027Tenant was missing\u0027?","commit_id":"61b000328cf9be28dffb7ff0459bd92d40caa263"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"class QuotaMissingTenant(BadRequest):"},{"line_number":232,"context_line":"    message \u003d _(\"Tenant was missing\")"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"class InvalidQuotaValue(Conflict):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAN3%2F%2F4ro%3D","line":232,"updated":"2013-03-08 02:25:14.000000000","message":"maybe something more descriptive, like \n\nTenant-id missing from Quota request.","commit_id":"118a19e572e0de308f5f4c1adadcf90416db5caf"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"class QuotaMissingTenant(BadRequest):"},{"line_number":232,"context_line":"    message \u003d _(\"Tenant was missing\")"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"class InvalidQuotaValue(Conflict):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAN3%2F%2F3eU%3D","line":232,"in_reply_to":"AAAAN3%2F%2F4ro%3D","updated":"2013-03-08 08:19:36.000000000","message":"Done","commit_id":"118a19e572e0de308f5f4c1adadcf90416db5caf"}],"quantum/extensions/quotasv2.py":[{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"80d788cf846537c9bd557e2c4a08b9b03ef58331","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        context \u003d request.context"},{"line_number":63,"context_line":"        if not context.is_admin:"},{"line_number":64,"context_line":"            reason \u003d _(\"Only admin can operate quota\")"},{"line_number":65,"context_line":"            raise exceptions.AdminRequired(reason\u003dreason)"},{"line_number":66,"context_line":"        return {self._resource_name + \"s\":"},{"line_number":67,"context_line":"                self._driver.get_all_quotas(context, QUOTAS.resources)}"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAM3%2F%2FJOI%3D","line":65,"updated":"2013-02-05 18:42:19.000000000","message":"may be not related with this patch.\nBut is this should be done by policy.json?","commit_id":"6ec90ad8684e42082b687b8300f11d4c22de9ae8"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"unresolved":false,"context_lines":[{"line_number":65,"context_line":"                [q for q in self._driver.get_all_quotas("},{"line_number":66,"context_line":"                    context, QUOTAS.resources) if policy.check(context,"},{"line_number":67,"context_line":"                                                               \u0027get_quotas\u0027,"},{"line_number":68,"context_line":"                                                               q)]}"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def tenant(self, request):"},{"line_number":71,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B%2FkI%3D","line":68,"updated":"2013-02-12 07:17:05.000000000","message":"When quota-list is called by a regular user, the response is changed from HTTPForbidden to an empty list.\nI am not sure it is your intention, but HTTPForbidden looks easier to understand to me.\n\nHow about using the same logic as delete() or update()?","commit_id":"6d6c85bbc9739992a3aa3efe9b853a9f72da56fd"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                [q for q in self._driver.get_all_quotas("},{"line_number":66,"context_line":"                    context, QUOTAS.resources) if policy.check(context,"},{"line_number":67,"context_line":"                                                               \u0027get_quotas\u0027,"},{"line_number":68,"context_line":"                                                               q)]}"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def tenant(self, request):"},{"line_number":71,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B7a0%3D","line":68,"in_reply_to":"AAAAM3%2F%2B%2Bcc%3D","updated":"2013-02-14 04:38:48.000000000","message":"Nachi, thanks for your reply, and there is another reason, user can change the policy in policy.conf. so the policy also can be \u0027admin_or_owner\u0027 or something else.  The policy \u0027\u0027admin_or_owner\u0027\u0027 need check the quota\u0027s tenant id.\n\nBut Akihiro, you notice me, this change  HTTPForbidden to an empty list. so this break API compatibility. We can\u0027t enable policy now. I will roll back the patch","commit_id":"6d6c85bbc9739992a3aa3efe9b853a9f72da56fd"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"80d788cf846537c9bd557e2c4a08b9b03ef58331","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                [q for q in self._driver.get_all_quotas("},{"line_number":66,"context_line":"                    context, QUOTAS.resources) if policy.check(context,"},{"line_number":67,"context_line":"                                                               \u0027get_quotas\u0027,"},{"line_number":68,"context_line":"                                                               q)]}"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def tenant(self, request):"},{"line_number":71,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B%2Bcc%3D","line":68,"in_reply_to":"AAAAM3%2F%2B%2FkI%3D","updated":"2013-02-12 18:41:55.000000000","message":"IMO, it is general behavior in the quantum.\nFor example, list_subnets returns [] if the user has no permission on policy.","commit_id":"6d6c85bbc9739992a3aa3efe9b853a9f72da56fd"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"unresolved":false,"context_lines":[{"line_number":80,"context_line":"        return {self._resource_name:"},{"line_number":81,"context_line":"                self._get_quotas(request, id)}"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _check_modification_delete_privilege(self, context, tenant_id):"},{"line_number":84,"context_line":"        if not tenant_id:"},{"line_number":85,"context_line":"            raise exceptions.QuotaInvalidTenant(tenant_id\u003dtenant_id)"},{"line_number":86,"context_line":"        if not context.is_admin:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B%2Fj4%3D","line":83,"updated":"2013-02-12 07:17:05.000000000","message":"This method no longer seems to be used.","commit_id":"6d6c85bbc9739992a3aa3efe9b853a9f72da56fd"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        return {self._resource_name:"},{"line_number":81,"context_line":"                self._get_quotas(request, id)}"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _check_modification_delete_privilege(self, context, tenant_id):"},{"line_number":84,"context_line":"        if not tenant_id:"},{"line_number":85,"context_line":"            raise exceptions.QuotaInvalidTenant(tenant_id\u003dtenant_id)"},{"line_number":86,"context_line":"        if not context.is_admin:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAM3%2F%2B7d8%3D","line":83,"in_reply_to":"AAAAM3%2F%2B%2Fj4%3D","updated":"2013-02-14 04:38:48.000000000","message":"Done","commit_id":"6d6c85bbc9739992a3aa3efe9b853a9f72da56fd"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def index(self, request):"},{"line_number":62,"context_line":"        context \u003d request.context"},{"line_number":63,"context_line":"        self._check_admin(context)"},{"line_number":64,"context_line":"        return {self._resource_name + \"s\":"},{"line_number":65,"context_line":"                self._driver.get_all_quotas(context, QUOTAS.resources)}"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BsmQ%3D","line":63,"updated":"2013-02-21 10:41:41.000000000","message":"Have you tried to use the policy engine instead of hardwiring the auth check here?\n\nNOTE: I am aware of a problem with extensions and authZ, which probably went away as a side effect of a recent patch we merged.\n\nIf the policy engine still does not kick in for extension, would you consider moving the authZ check in the \u0027implementation\u0027 of the API, and leverage the policy engine with a \u0027hardcoded\u0027 rule (see provider network rules as an example)?","commit_id":"49b3ef828eb008934f4e42156d2f825862ade1c8"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def index(self, request):"},{"line_number":62,"context_line":"        context \u003d request.context"},{"line_number":63,"context_line":"        self._check_admin(context)"},{"line_number":64,"context_line":"        return {self._resource_name + \"s\":"},{"line_number":65,"context_line":"                self._driver.get_all_quotas(context, QUOTAS.resources)}"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Bqzg%3D","line":63,"in_reply_to":"AAAAM3%2F%2BsmQ%3D","updated":"2013-02-22 03:22:32.000000000","message":"Yes, I have tried to use policy engine at patchset4. But I think that will broken quota api compatibility. Current code list quota without admin, will return status code 403. After enable policy engine, when quota list return empty and without admin? it will return empty list instead of 403 (core resource doing same way.),","commit_id":"49b3ef828eb008934f4e42156d2f825862ade1c8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return {self._resource_name + \"s\":"},{"line_number":65,"context_line":"                self._driver.get_all_quotas(context, QUOTAS.resources)}"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def tenant(self, request):"},{"line_number":68,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""},{"line_number":69,"context_line":"        context \u003d request.context"},{"line_number":70,"context_line":"        if not context.tenant_id:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Bsl0%3D","line":67,"updated":"2013-02-21 10:41:41.000000000","message":"Where\u0027s this method used? I suspect it was meant to validate the tenant submitting a request (ie.: for doing admin_or_owner equivalent policy), but I can\u0027t see where it\u0027s called throughout the code.","commit_id":"49b3ef828eb008934f4e42156d2f825862ade1c8"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return {self._resource_name + \"s\":"},{"line_number":65,"context_line":"                self._driver.get_all_quotas(context, QUOTAS.resources)}"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def tenant(self, request):"},{"line_number":68,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""},{"line_number":69,"context_line":"        context \u003d request.context"},{"line_number":70,"context_line":"        if not context.tenant_id:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Bqzs%3D","line":67,"in_reply_to":"AAAAM3%2F%2Bsl0%3D","updated":"2013-02-22 03:22:32.000000000","message":"when execute \u0027quantum quota-update\u0027, the client use request as \u0027curl -i http://cloudcontroller:9696/v2.0/quotas/tenant.json -X GET\u0027 for get current context tenant-id","commit_id":"49b3ef828eb008934f4e42156d2f825862ade1c8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":68,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""},{"line_number":69,"context_line":"        context \u003d request.context"},{"line_number":70,"context_line":"        if not context.tenant_id:"},{"line_number":71,"context_line":"            raise exceptions.QuotaInvalidTenant(tenant_id\u003dcontext.tenant_id)"},{"line_number":72,"context_line":"        return {\u0027tenant\u0027: {\u0027tenant_id\u0027: context.tenant_id}}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def show(self, request, id):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Bsl8%3D","line":71,"updated":"2013-02-21 10:41:41.000000000","message":"the tenant_id you\u0027re are passing to the exception constructor is None or empty.\n\nIs this really what you want to do?","commit_id":"49b3ef828eb008934f4e42156d2f825862ade1c8"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""},{"line_number":69,"context_line":"        context \u003d request.context"},{"line_number":70,"context_line":"        if not context.tenant_id:"},{"line_number":71,"context_line":"            raise exceptions.QuotaInvalidTenant(tenant_id\u003dcontext.tenant_id)"},{"line_number":72,"context_line":"        return {\u0027tenant\u0027: {\u0027tenant_id\u0027: context.tenant_id}}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def show(self, request, id):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Bq0k%3D","line":71,"in_reply_to":"AAAAM3%2F%2Bsl8%3D","updated":"2013-02-22 03:22:32.000000000","message":"Done","commit_id":"49b3ef828eb008934f4e42156d2f825862ade1c8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":91,"context_line":"        self._check_admin(request.context)"},{"line_number":92,"context_line":"        attr_info \u003d EXTENDED_ATTRIBUTES_2_0[RESOURCE_COLLECTION]"},{"line_number":93,"context_line":"        body \u003d base.Controller.prepare_request_body("},{"line_number":94,"context_line":"            request.context, body, False, self._resource_name, attr_info)"},{"line_number":95,"context_line":"        for key in body[self._resource_name].keys():"},{"line_number":96,"context_line":"            if key in QUOTAS.resources:"},{"line_number":97,"context_line":"                value \u003d int(body[self._resource_name][key])"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2BslU%3D","line":94,"updated":"2013-02-21 10:41:41.000000000","message":"why not just self.prepare_request_body ?","commit_id":"49b3ef828eb008934f4e42156d2f825862ade1c8"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        self._check_admin(request.context)"},{"line_number":92,"context_line":"        attr_info \u003d EXTENDED_ATTRIBUTES_2_0[RESOURCE_COLLECTION]"},{"line_number":93,"context_line":"        body \u003d base.Controller.prepare_request_body("},{"line_number":94,"context_line":"            request.context, body, False, self._resource_name, attr_info)"},{"line_number":95,"context_line":"        for key in body[self._resource_name].keys():"},{"line_number":96,"context_line":"            if key in QUOTAS.resources:"},{"line_number":97,"context_line":"                value \u003d int(body[self._resource_name][key])"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Bq0o%3D","line":94,"in_reply_to":"AAAAM3%2F%2BslU%3D","updated":"2013-02-22 03:22:32.000000000","message":"This class based on quantum.wsgi.Controller, not quantum.api.v2.base.Controller.","commit_id":"49b3ef828eb008934f4e42156d2f825862ade1c8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":74,"context_line":"    def show(self, request, id):"},{"line_number":75,"context_line":"        if id !\u003d request.context.tenant_id:"},{"line_number":76,"context_line":"            self._check_admin(request.context,"},{"line_number":77,"context_line":"                              reason\u003d_(\"Admin required when operate \""},{"line_number":78,"context_line":"                                       \"other tenant\"))"},{"line_number":79,"context_line":"        return {self._resource_name:"},{"line_number":80,"context_line":"                self._get_quotas(request, id)}"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAM3%2F%2BniQ%3D","line":77,"updated":"2013-02-25 17:49:10.000000000","message":"Consider: \"Admin required when accessing another tenant\"","commit_id":"c41d17fc5c6f8b66ba9c6aa2acc72fef8e64ab84"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    def show(self, request, id):"},{"line_number":75,"context_line":"        if id !\u003d request.context.tenant_id:"},{"line_number":76,"context_line":"            self._check_admin(request.context,"},{"line_number":77,"context_line":"                              reason\u003d_(\"Admin required when operate \""},{"line_number":78,"context_line":"                                       \"other tenant\"))"},{"line_number":79,"context_line":"        return {self._resource_name:"},{"line_number":80,"context_line":"                self._get_quotas(request, id)}"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAM3%2F%2Bmuk%3D","line":77,"in_reply_to":"AAAAM3%2F%2BniQ%3D","updated":"2013-02-26 01:15:22.000000000","message":"Done","commit_id":"c41d17fc5c6f8b66ba9c6aa2acc72fef8e64ab84"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":79,"context_line":"        return {self._resource_name:"},{"line_number":80,"context_line":"                self._get_quotas(request, id)}"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def _check_admin(self, context, reason\u003d_(\"Only admin can operate quota\")):"},{"line_number":83,"context_line":"        if not context.is_admin:"},{"line_number":84,"context_line":"            raise exceptions.AdminRequired(reason\u003dreason)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAM3%2F%2BniI%3D","line":82,"updated":"2013-02-25 17:49:10.000000000","message":"operate \u003d\u003e configure","commit_id":"c41d17fc5c6f8b66ba9c6aa2acc72fef8e64ab84"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        return {self._resource_name:"},{"line_number":80,"context_line":"                self._get_quotas(request, id)}"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def _check_admin(self, context, reason\u003d_(\"Only admin can operate quota\")):"},{"line_number":83,"context_line":"        if not context.is_admin:"},{"line_number":84,"context_line":"            raise exceptions.AdminRequired(reason\u003dreason)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAM3%2F%2Bmug%3D","line":82,"in_reply_to":"AAAAM3%2F%2BniI%3D","updated":"2013-02-26 01:15:22.000000000","message":"Done","commit_id":"c41d17fc5c6f8b66ba9c6aa2acc72fef8e64ab84"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":80,"context_line":"                self._get_quotas(request, id)}"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def _check_admin(self, context,"},{"line_number":83,"context_line":"                     reason\u003d_(\"Only admin can configure quota\")):"},{"line_number":84,"context_line":"        if not context.is_admin:"},{"line_number":85,"context_line":"            raise exceptions.AdminRequired(reason\u003dreason)"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAANH%2F%2F%2FgA%3D","line":83,"updated":"2013-02-28 05:22:40.000000000","message":"i\u0027m not sure this default message makes sense, as you call _check_admin from READ methods as well (e.g., index() above).  Maybe just change it to \"view or configure quotas\".","commit_id":"56cf9bea6fe87b099c29d09f42ab9f9cfc2c2362"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                self._get_quotas(request, id)}"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def _check_admin(self, context,"},{"line_number":83,"context_line":"                     reason\u003d_(\"Only admin can configure quota\")):"},{"line_number":84,"context_line":"        if not context.is_admin:"},{"line_number":85,"context_line":"            raise exceptions.AdminRequired(reason\u003dreason)"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAANH%2F%2F%2Fb0%3D","line":83,"in_reply_to":"AAAANH%2F%2F%2FgA%3D","updated":"2013-02-28 07:45:30.000000000","message":"Done","commit_id":"56cf9bea6fe87b099c29d09f42ab9f9cfc2c2362"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":95,"context_line":"            request.context, body, False, self._resource_name, attr_info)"},{"line_number":96,"context_line":"        for key in body[self._resource_name].keys():"},{"line_number":97,"context_line":"            if key in QUOTAS.resources:"},{"line_number":98,"context_line":"                value \u003d int(body[self._resource_name][key])"},{"line_number":99,"context_line":"                self._driver.update_quota_limit(request.context,"},{"line_number":100,"context_line":"                                                id,"},{"line_number":101,"context_line":"                                                key,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAANH%2F%2F%2Ff4%3D","line":98,"updated":"2013-02-28 05:22:40.000000000","message":"should we catch parse error here and return 400, as opposed to it resulting in a 500?  Or do we case the parsing error somewhere else already?","commit_id":"56cf9bea6fe87b099c29d09f42ab9f9cfc2c2362"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            request.context, body, False, self._resource_name, attr_info)"},{"line_number":96,"context_line":"        for key in body[self._resource_name].keys():"},{"line_number":97,"context_line":"            if key in QUOTAS.resources:"},{"line_number":98,"context_line":"                value \u003d int(body[self._resource_name][key])"},{"line_number":99,"context_line":"                self._driver.update_quota_limit(request.context,"},{"line_number":100,"context_line":"                                                id,"},{"line_number":101,"context_line":"                                                key,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAANH%2F%2F%2FXk%3D","line":98,"in_reply_to":"AAAANH%2F%2F%2Ff4%3D","updated":"2013-02-28 07:45:30.000000000","message":"you are right. I will fix it","commit_id":"56cf9bea6fe87b099c29d09f42ab9f9cfc2c2362"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":117,"context_line":"    @classmethod"},{"line_number":118,"context_line":"    def get_description(cls):"},{"line_number":119,"context_line":"        return (\"Expose functions for cloud admin to update quotas\""},{"line_number":120,"context_line":"                \"for each tenant\")"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    @classmethod"},{"line_number":123,"context_line":"    def get_namespace(cls):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAANH%2F%2F%2Ffs%3D","line":120,"updated":"2013-02-28 05:22:40.000000000","message":"this description is a bit incomplete, as it also lets tenants view their own quotas.","commit_id":"56cf9bea6fe87b099c29d09f42ab9f9cfc2c2362"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    @classmethod"},{"line_number":118,"context_line":"    def get_description(cls):"},{"line_number":119,"context_line":"        return (\"Expose functions for cloud admin to update quotas\""},{"line_number":120,"context_line":"                \"for each tenant\")"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    @classmethod"},{"line_number":123,"context_line":"    def get_namespace(cls):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAANH%2F%2F%2Fbw%3D","line":120,"in_reply_to":"AAAANH%2F%2F%2Ffs%3D","updated":"2013-02-28 07:45:30.000000000","message":"Done","commit_id":"56cf9bea6fe87b099c29d09f42ab9f9cfc2c2362"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":68,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""},{"line_number":69,"context_line":"        context \u003d request.context"},{"line_number":70,"context_line":"        if not context.tenant_id:"},{"line_number":71,"context_line":"            raise q_exc.QuotaTenantNotFound()"},{"line_number":72,"context_line":"        return {\u0027tenant\u0027: {\u0027tenant_id\u0027: context.tenant_id}}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def show(self, request, id):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2F%2FrE%3D","line":71,"updated":"2013-03-04 08:46:09.000000000","message":"QuotaMissingTenant is probably a more apt name.","commit_id":"61b000328cf9be28dffb7ff0459bd92d40caa263"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""},{"line_number":69,"context_line":"        context \u003d request.context"},{"line_number":70,"context_line":"        if not context.tenant_id:"},{"line_number":71,"context_line":"            raise q_exc.QuotaTenantNotFound()"},{"line_number":72,"context_line":"        return {\u0027tenant\u0027: {\u0027tenant_id\u0027: context.tenant_id}}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def show(self, request, id):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2F%2FLo%3D","line":71,"in_reply_to":"AAAAN3%2F%2F%2FrE%3D","updated":"2013-03-04 16:08:53.000000000","message":"Done","commit_id":"61b000328cf9be28dffb7ff0459bd92d40caa263"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":75,"context_line":"        if id !\u003d request.context.tenant_id:"},{"line_number":76,"context_line":"            self._check_admin(request.context,"},{"line_number":77,"context_line":"                              reason\u003d_(\"Admin required when accessing\""},{"line_number":78,"context_line":"                                       \" another tenant\"))"},{"line_number":79,"context_line":"        return {self._resource_name: self._get_quotas(request, id)}"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def _check_admin(self, context,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2F%2FrA%3D","line":78,"updated":"2013-03-04 08:46:09.000000000","message":"pedantry: I\u0027d move the whitespace from the beginning of line 78 to the end of line 77.\n\nAlso, I would consider to change the error message to \"Not authorised to access quotas for another tenant\"","commit_id":"61b000328cf9be28dffb7ff0459bd92d40caa263"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":75,"context_line":"        if id !\u003d request.context.tenant_id:"},{"line_number":76,"context_line":"            self._check_admin(request.context,"},{"line_number":77,"context_line":"                              reason\u003d_(\"Admin required when accessing\""},{"line_number":78,"context_line":"                                       \" another tenant\"))"},{"line_number":79,"context_line":"        return {self._resource_name: self._get_quotas(request, id)}"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def _check_admin(self, context,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2F%2FKU%3D","line":78,"in_reply_to":"AAAAN3%2F%2F%2Fl4%3D","updated":"2013-03-04 16:12:13.000000000","message":"sounds good","commit_id":"61b000328cf9be28dffb7ff0459bd92d40caa263"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        if id !\u003d request.context.tenant_id:"},{"line_number":76,"context_line":"            self._check_admin(request.context,"},{"line_number":77,"context_line":"                              reason\u003d_(\"Admin required when accessing\""},{"line_number":78,"context_line":"                                       \" another tenant\"))"},{"line_number":79,"context_line":"        return {self._resource_name: self._get_quotas(request, id)}"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def _check_admin(self, context,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2F%2Fl4%3D","line":78,"in_reply_to":"AAAAN3%2F%2F%2FrA%3D","updated":"2013-03-04 16:08:53.000000000","message":"Thanks, That looks better. How about \"Non-admin is not authorised to access quotas for another tenant\"?","commit_id":"61b000328cf9be28dffb7ff0459bd92d40caa263"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        self._check_admin(request.context)"},{"line_number":92,"context_line":"        body \u003d base.Controller.prepare_request_body("},{"line_number":93,"context_line":"            request.context, body, False, self._resource_name,"},{"line_number":94,"context_line":"            EXTENDED_ATTRIBUTES_2_0[RESOURCE_COLLECTION])"},{"line_number":95,"context_line":"        for key, value in body[self._resource_name].iteritems():"},{"line_number":96,"context_line":"            self._driver.update_quota_limit(request.context, id, key, value)"},{"line_number":97,"context_line":"        return {self._resource_name: self._get_quotas(request, id)}"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAANH%2F%2F%2FFw%3D","line":94,"updated":"2013-02-28 15:40:25.000000000","message":"This check request body as attribute mapping. Same as core resource doing.","commit_id":"61b000328cf9be28dffb7ff0459bd92d40caa263"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":68,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""},{"line_number":69,"context_line":"        context \u003d request.context"},{"line_number":70,"context_line":"        if not context.tenant_id:"},{"line_number":71,"context_line":"            raise q_exc.QuotaMissingTenant()"},{"line_number":72,"context_line":"        return {\u0027tenant\u0027: {\u0027tenant_id\u0027: context.tenant_id}}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def show(self, request, id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAN3%2F%2F9f4%3D","line":71,"updated":"2013-03-05 07:06:06.000000000","message":"I do not think that this is good - on the client you will get the exception. This should be a webob exception","commit_id":"ed50fb101940c7f42a57716557bc71eca89ef811"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":68,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""},{"line_number":69,"context_line":"        context \u003d request.context"},{"line_number":70,"context_line":"        if not context.tenant_id:"},{"line_number":71,"context_line":"            raise q_exc.QuotaMissingTenant()"},{"line_number":72,"context_line":"        return {\u0027tenant\u0027: {\u0027tenant_id\u0027: context.tenant_id}}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def show(self, request, id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAN3%2F%2F9Fk%3D","line":71,"in_reply_to":"AAAAN3%2F%2F9Ug%3D","updated":"2013-03-05 12:59:13.000000000","message":"yes, you are correct.","commit_id":"ed50fb101940c7f42a57716557bc71eca89ef811"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        \"\"\"Retrieve the tenant info in context.\"\"\""},{"line_number":69,"context_line":"        context \u003d request.context"},{"line_number":70,"context_line":"        if not context.tenant_id:"},{"line_number":71,"context_line":"            raise q_exc.QuotaMissingTenant()"},{"line_number":72,"context_line":"        return {\u0027tenant\u0027: {\u0027tenant_id\u0027: context.tenant_id}}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def show(self, request, id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAN3%2F%2F9Ug%3D","line":71,"in_reply_to":"AAAAN3%2F%2F9f4%3D","updated":"2013-03-05 08:47:51.000000000","message":"This will map to webob exception. because we wrap this controller by resource.Resource","commit_id":"ed50fb101940c7f42a57716557bc71eca89ef811"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":81,"context_line":"    def _check_admin(self, context,"},{"line_number":82,"context_line":"                     reason\u003d_(\"Only admin can view or configure quota\")):"},{"line_number":83,"context_line":"        if not context.is_admin:"},{"line_number":84,"context_line":"            raise q_exc.AdminRequired(reason\u003dreason)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def delete(self, request, id):"},{"line_number":87,"context_line":"        self._check_admin(request.context)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAN3%2F%2F9f8%3D","line":84,"updated":"2013-03-05 07:06:06.000000000","message":"ditto","commit_id":"ed50fb101940c7f42a57716557bc71eca89ef811"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    def _check_admin(self, context,"},{"line_number":82,"context_line":"                     reason\u003d_(\"Only admin can view or configure quota\")):"},{"line_number":83,"context_line":"        if not context.is_admin:"},{"line_number":84,"context_line":"            raise q_exc.AdminRequired(reason\u003dreason)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def delete(self, request, id):"},{"line_number":87,"context_line":"        self._check_admin(request.context)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAN3%2F%2F9Us%3D","line":84,"in_reply_to":"AAAAN3%2F%2F9f8%3D","updated":"2013-03-05 08:47:51.000000000","message":"same","commit_id":"ed50fb101940c7f42a57716557bc71eca89ef811"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":113,"context_line":"                                                              id)"},{"line_number":114,"context_line":"        req_body \u003d self._get_body(request)"},{"line_number":115,"context_line":"        for key in req_body[self._resource_name].keys():"},{"line_number":116,"context_line":"            if key in QUOTAS.resources:"},{"line_number":117,"context_line":"                value \u003d int(req_body[self._resource_name][key])"},{"line_number":118,"context_line":"                self._driver.update_quota_limit(request.context,"},{"line_number":119,"context_line":"                                                tenant_id,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAN3%2F%2F4qs%3D","side":"PARENT","line":116,"updated":"2013-03-08 02:25:14.000000000","message":"was this check redundant, as I don\u0027t see an equivalent check in the new patch.","commit_id":"bbbfdfe653fc5aaa201ab2da30b02f4245d9bbeb"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                                                              id)"},{"line_number":114,"context_line":"        req_body \u003d self._get_body(request)"},{"line_number":115,"context_line":"        for key in req_body[self._resource_name].keys():"},{"line_number":116,"context_line":"            if key in QUOTAS.resources:"},{"line_number":117,"context_line":"                value \u003d int(req_body[self._resource_name][key])"},{"line_number":118,"context_line":"                self._driver.update_quota_limit(request.context,"},{"line_number":119,"context_line":"                                                tenant_id,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAN3%2F%2F3eY%3D","side":"PARENT","line":116,"in_reply_to":"AAAAN3%2F%2F4qs%3D","updated":"2013-03-08 08:19:36.000000000","message":"This check was redundant. This case have already checked by base.Controller.prepare_request_body.\n\nAnd we have test case \u0027test_update_quotas_with_non_support_resource_returns_400\u0027 for this case","commit_id":"bbbfdfe653fc5aaa201ab2da30b02f4245d9bbeb"}],"quantum/tests/unit/test_quota_per_tenant_ext.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":138,"context_line":"                           extra_environ\u003denv)"},{"line_number":139,"context_line":"        self.assertEqual(200, res.status_int)"},{"line_number":140,"context_line":"        quota \u003d self.deserialize(res)"},{"line_number":141,"context_line":"        self.assertEqual([], quota[\u0027quotas\u0027])"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def test_list_quotas_without_admin_forbidden_returns_403(self):"},{"line_number":144,"context_line":"        tenant_id \u003d \u0027tenant_id1\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2F%2Fqc%3D","line":141,"updated":"2013-03-04 08:46:09.000000000","message":"I have a question, but it might be just me being confused.\nWhy do we obtain an empty list?\nI seem to recall the expected behaviour would be to obtain quotas for all registered tenants.","commit_id":"61b000328cf9be28dffb7ff0459bd92d40caa263"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5ced9b0a3d9f017070eeddc222ed7eea707da8b7","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                           extra_environ\u003denv)"},{"line_number":139,"context_line":"        self.assertEqual(200, res.status_int)"},{"line_number":140,"context_line":"        quota \u003d self.deserialize(res)"},{"line_number":141,"context_line":"        self.assertEqual([], quota[\u0027quotas\u0027])"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def test_list_quotas_without_admin_forbidden_returns_403(self):"},{"line_number":144,"context_line":"        tenant_id \u003d \u0027tenant_id1\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2F%2FmI%3D","line":141,"in_reply_to":"AAAAN3%2F%2F%2Fqc%3D","updated":"2013-03-04 16:08:53.000000000","message":"If you have never updated the qouta, quota extension won\u0027t show the default value. You can see the quotas after update quota of one of resource.","commit_id":"61b000328cf9be28dffb7ff0459bd92d40caa263"}]}
