)]}'
{"api-ref/source/parameters.yaml":[{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"a763bd8f0aa6aba831fa5d1a0b97c7f65efd60e4","unresolved":false,"context_lines":[{"line_number":381,"context_line":"  description: |"},{"line_number":382,"context_line":"    If present, this is a \"/\" -delimited list of containers which"},{"line_number":383,"context_line":"    should be excluded from the quota mechanism."},{"line_number":384,"context_line":"    Typically this value is set by an administrator."},{"line_number":385,"context_line":"  in: header"},{"line_number":386,"context_line":"  required: false"},{"line_number":387,"context_line":"  type: string"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"df140735_c6cb1e70","line":384,"range":{"start_line":384,"start_character":4,"end_line":384,"end_character":52},"updated":"2017-06-07 19:54:57.000000000","message":"I\u0027d say:\n\"This value must be set by an administrator with Reseller Admin role\"","commit_id":"2b9ad188cf0fac7e856d9a9a2a12d23dba44e7f4"}],"etc/proxy-server.conf-sample":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"38e5c36c69e46ba77bf8559a3d6f1b5cdf9f0ddc","unresolved":false,"context_lines":[{"line_number":736,"context_line":"# Set this to the maximum count of containers, which can be excluded from the"},{"line_number":737,"context_line":"# quota mechanism by an reseller using the x-account-quota-exclude-containers"},{"line_number":738,"context_line":"# header."},{"line_number":739,"context_line":"# exclude_containers_limit \u003d 10"},{"line_number":740,"context_line":""},{"line_number":741,"context_line":"[filter:gatekeeper]"},{"line_number":742,"context_line":"use \u003d egg:swift#gatekeeper"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"df140735_b0bbe0c2","line":739,"range":{"start_line":739,"start_character":29,"end_line":739,"end_character":31},"updated":"2017-06-07 06:14:43.000000000","message":"Now, this is 0 in default.","commit_id":"dae58221a12c3e08479188b0b49292db9486cd74"}],"swift/common/middleware/account_quotas.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"202f07b9a6e668d61c16c2042f3d12d2cb78da5a","unresolved":false,"context_lines":[{"line_number":23,"context_line":"resellers. There is no quota limit if ``x-account-meta-quota-bytes`` is not"},{"line_number":24,"context_line":"set."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Beyond that, it is possible for a reseller to add a ``/``-delimited list"},{"line_number":27,"context_line":"of containers inside the ``x-account-meta-quota-exclude-containers`` metadata"},{"line_number":28,"context_line":"entry, which should be excluded from the quota mechanism. (PUT, POST)"},{"line_number":29,"context_line":"requests to these containers will ignore the quota mechanism, and the total"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a3c09a3_50293736","line":26,"range":{"start_line":26,"start_character":52,"end_line":26,"end_character":72},"updated":"2017-01-17 18:45:56.000000000","message":"Clever :-)\n\nAnother option would be to require that the containers be url-encoded, so \"my,container\" becomes \"my%2ccontainer\" and you can still use CSV.","commit_id":"448eab42f5cd733bd8cd1197c2a7dc1a65912380"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"202f07b9a6e668d61c16c2042f3d12d2cb78da5a","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            remove_quota \u003d request.headers.get("},{"line_number":95,"context_line":"                \u0027X-Remove-Account-Meta-Quota-Bytes\u0027)"},{"line_number":96,"context_line":"            excl_ctrs \u003d request.headers.get("},{"line_number":97,"context_line":"                \u0027X-Account-Meta-Quota-Exclude-Containers\u0027)"},{"line_number":98,"context_line":"        else:"},{"line_number":99,"context_line":"            # container or object request; even if the quota headers are set"},{"line_number":100,"context_line":"            # in the request, they\u0027re meaningless"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a3c09a3_ab04ac17","line":97,"updated":"2017-01-17 18:45:56.000000000","message":"A non-reseller user on an older cloud may still set this header with the expectation that the deployer will upgrade later, no? If the reseller never has a reason to set any exclude containers for that account, they may not realize that containers are being excluded.\n\nIt\u0027s probably better to store this in sysmeta, which we *know* the user can\u0027t set.","commit_id":"448eab42f5cd733bd8cd1197c2a7dc1a65912380"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"202f07b9a6e668d61c16c2042f3d12d2cb78da5a","unresolved":false,"context_lines":[{"line_number":135,"context_line":"            if container \u003d\u003d exctr:"},{"line_number":136,"context_line":"                return self.app"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"            container_info \u003d get_info("},{"line_number":139,"context_line":"                self.app, request.environ, account, exctr)"},{"line_number":140,"context_line":"            if container_info:"},{"line_number":141,"context_line":"                excl_size +\u003d int(container_info[\u0027bytes\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a3c09a3_0b6a20ee","line":138,"updated":"2017-01-17 18:45:56.000000000","message":"So each object PUT will now require N container HEADs? I know that we generally assume get_container_info calls to be more or less free (since they should be cache hits), but I wonder if this may be too much?\n\nFWIW, with the value currently being stored in user meta, there\u0027ll be a built-in limit on the number of containers that can be excluded. Given the default 256-byte meta value limit, you can get 90+ unique containers excluded, which seems kinda terrible. On the other hand, it\u0027s the reseller doing the setting, so I guess it\u0027s on them to make sure they don\u0027t shoot themselves in the foot?\n\nNote that if you move this to sysmeta, the built-in limit goes way up; as I recall it falls back to max_header_size to do the enforcing.\n\nI think it might be a good idea to have some (configurable) limit on the number of containers that may be excluded. Default it to 10 maybe?","commit_id":"448eab42f5cd733bd8cd1197c2a7dc1a65912380"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"202f07b9a6e668d61c16c2042f3d12d2cb78da5a","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            container_info \u003d get_info("},{"line_number":139,"context_line":"                self.app, request.environ, account, exctr)"},{"line_number":140,"context_line":"            if container_info:"},{"line_number":141,"context_line":"                excl_size +\u003d int(container_info[\u0027bytes\u0027])"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        new_size \u003d int(account_info[\u0027bytes\u0027]) + content_length - excl_size"},{"line_number":144,"context_line":"        if quota \u003c new_size:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a3c09a3_8b5d3049","line":141,"range":{"start_line":141,"start_character":29,"end_line":141,"end_character":32},"updated":"2017-01-17 18:45:56.000000000","message":"I thought this was already coming out as an int? Eh, better safe than sorry, I suppose.","commit_id":"448eab42f5cd733bd8cd1197c2a7dc1a65912380"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"56940d0862ba6485744f54434bd9ae1391ded085","unresolved":false,"context_lines":[{"line_number":24,"context_line":"set."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Beyond that, it is possible for a reseller to add a ``/``-delimited list"},{"line_number":27,"context_line":"of containers with the ``x-account-meta-quota-exclude-containers`` metadata"},{"line_number":28,"context_line":"header, which should be excluded from the quota mechanism. (PUT, POST)"},{"line_number":29,"context_line":"requests to these containers will ignore the quota mechanism, and the total"},{"line_number":30,"context_line":"size of these containers will be substracted from the current bytes used of"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a3905b3_de7cda22","line":27,"range":{"start_line":27,"start_character":25,"end_line":27,"end_character":40},"updated":"2017-01-19 22:10:30.000000000","message":"Now that this will be stored in sysmeta, it\u0027s probably better to have the client header be something like X-Account-Quota-Exclude-Containers.","commit_id":"abe7570641709e6cf2ea4ff6e82cb5c8381a084c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"56940d0862ba6485744f54434bd9ae1391ded085","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        self.app \u003d app"},{"line_number":83,"context_line":"        conf \u003d args[0] if len(args) \u003e 0 else {}"},{"line_number":84,"context_line":"        self.excl_ctrs_limit \u003d int("},{"line_number":85,"context_line":"            conf.get(\u0027exclude_containers_limit\u0027, 10))"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @wsgify"},{"line_number":88,"context_line":"    def __call__(self, request):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a3905b3_7eccc635","line":85,"updated":"2017-01-19 22:10:30.000000000","message":"We should add this to proxy-server.conf-sample","commit_id":"abe7570641709e6cf2ea4ff6e82cb5c8381a084c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"56940d0862ba6485744f54434bd9ae1391ded085","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            if excl_ctrs:"},{"line_number":120,"context_line":"                # Do not exceed the limit."},{"line_number":121,"context_line":"                if len(excl_ctrs.split(\u0027/\u0027)) \u003e self.excl_ctrs_limit:"},{"line_number":122,"context_line":"                    return HTTPConflict("},{"line_number":123,"context_line":"                        \u0027It is not allowed to exclude more than %d\u0027"},{"line_number":124,"context_line":"                        \u0027 containers from the account quota.\u0027"},{"line_number":125,"context_line":"                        % self.excl_ctrs_limit)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a3905b3_9ee7b2e3","line":122,"range":{"start_line":122,"start_character":27,"end_line":122,"end_character":39},"updated":"2017-01-19 22:10:30.000000000","message":"Better as HTTPBadRequest? Conflict is typically used when there\u0027s some mismatch between the server state and what the client *thinks* the server state is. This is just a client sending a bad value.","commit_id":"abe7570641709e6cf2ea4ff6e82cb5c8381a084c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"56940d0862ba6485744f54434bd9ae1391ded085","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                # Do not exceed the limit."},{"line_number":121,"context_line":"                if len(excl_ctrs.split(\u0027/\u0027)) \u003e self.excl_ctrs_limit:"},{"line_number":122,"context_line":"                    return HTTPConflict("},{"line_number":123,"context_line":"                        \u0027It is not allowed to exclude more than %d\u0027"},{"line_number":124,"context_line":"                        \u0027 containers from the account quota.\u0027"},{"line_number":125,"context_line":"                        % self.excl_ctrs_limit)"},{"line_number":126,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a3905b3_1e2102fc","line":123,"range":{"start_line":123,"start_character":25,"end_line":123,"end_character":53},"updated":"2017-01-19 22:10:30.000000000","message":"nit: \"You may not exclude ...\" reads a bit better to me.","commit_id":"abe7570641709e6cf2ea4ff6e82cb5c8381a084c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"56940d0862ba6485744f54434bd9ae1391ded085","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                # Move header to sysmeta, so that non-reseller users of an"},{"line_number":128,"context_line":"                # older cloud are not able to set the excluded containers."},{"line_number":129,"context_line":"                request.headers.pop(\u0027X-Account-Meta-Quota-Exclude-Containers\u0027)"},{"line_number":130,"context_line":"                request.headers[SYSMETA_EXCL_CTRS] \u003d excl_ctrs"},{"line_number":131,"context_line":"            return self.app"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        # deny quota set for non-reseller"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a3905b3_beb54ece","line":130,"updated":"2017-01-19 22:10:30.000000000","message":"Should there be a similar translation on account GET? (Maybe conditional on request.environ.get(\u0027reseller_request\u0027) being true?)","commit_id":"abe7570641709e6cf2ea4ff6e82cb5c8381a084c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"fb48740fc5dd90d5ec1c50dee8fd82df3bb8762a","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    \"\"\""},{"line_number":83,"context_line":"    def __init__(self, app, *args, **kwargs):"},{"line_number":84,"context_line":"        self.app \u003d app"},{"line_number":85,"context_line":"        conf \u003d args[0] if len(args) \u003e 0 else {}"},{"line_number":86,"context_line":"        self.excl_ctrs_limit \u003d int("},{"line_number":87,"context_line":"            conf.get(\u0027exclude_containers_limit\u0027, 10))"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_d55a8929","line":85,"range":{"start_line":85,"start_character":15,"end_line":85,"end_character":39},"updated":"2017-02-23 13:43:00.000000000","message":"Is this if always True?\n\nWhen i change here as\n\n conf \u003d args[0]\n\nAnd I like strict args at __init__ as\n\n def __init__(self, app, conf):\n\n\n... ugh! it looks like the guilty is from test code, like:\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nERROR: test_valid_quotas_reseller (test.unit.common.middleware.test_account_quotas.TestAccountQuota)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"/opt/stack/swift/test/unit/common/middleware/test_account_quotas.py\", line 354, in test_valid_quotas_reseller\n    app \u003d account_quotas.AccountQuotaMiddleware(FakeApp(headers))\n  File \"/opt/stack/swift/swift/common/middleware/account_quotas.py\", line 85, in __init__\n    conf \u003d args[0]\nIndexError: tuple index out of range\n\n----------------------------------------------------------------------\n\nI\u0027m not sure we should fix the buggy test code at once but the simple fix is to feed empty dict for test cases and it looks intuitive to me.","commit_id":"cb17eed88b4827aed00ae9e0140d3046cacd6b4f"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"fb48740fc5dd90d5ec1c50dee8fd82df3bb8762a","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        request \u003d Request(env)"},{"line_number":91,"context_line":"        if (request.method in (\u0027GET\u0027, \u0027HEAD\u0027) and"},{"line_number":92,"context_line":"                request.environ.get(\u0027reseller_request\u0027) is True):"},{"line_number":93,"context_line":"            def _start_response(status, headers, exc_info\u003dNone):"},{"line_number":94,"context_line":"                # Retranslate from sysmeta."},{"line_number":95,"context_line":"                for i, (h, v) in enumerate(headers):"},{"line_number":96,"context_line":"                    if h.lower() \u003d\u003d SYSMETA_EXCL_CTRS_HDR.lower():"},{"line_number":97,"context_line":"                        headers[i] \u003d (EXCL_CTRS_HDR, v)"},{"line_number":98,"context_line":"                        break"},{"line_number":99,"context_line":"                return start_response(status, headers, exc_info)"},{"line_number":100,"context_line":"            return self.app(env, _start_response)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        if request.method not in (\"POST\", \"PUT\"):"},{"line_number":103,"context_line":"            return self.app(env, start_response)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_156d0131","line":100,"range":{"start_line":93,"start_character":0,"end_line":100,"end_character":49},"updated":"2017-02-23 13:43:00.000000000","message":"perhaps, simply\n\n resp \u003d request.get_response(self.app)\n excl_ctrs_hdr \u003d resp.headers.pop(SYSMETA_EXCL_CTRS_HDR)\n if excl_ctrs_hdr:\n    # set exclude containers header as user meta from sysmeta\n    resp.headers[EXCL_CTRS_HDR] \u003d excl_ctrs_hdr\n    return resp(env, start_response)\n return resp(env, start_response)\n??","commit_id":"cb17eed88b4827aed00ae9e0140d3046cacd6b4f"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"fb48740fc5dd90d5ec1c50dee8fd82df3bb8762a","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        if request.environ.get(\u0027reseller_request\u0027) is True:"},{"line_number":127,"context_line":"            if new_quota and not new_quota.isdigit():"},{"line_number":128,"context_line":"                return HTTPBadRequest()(env, start_response)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"            if excl_ctrs:"},{"line_number":131,"context_line":"                # Do not exceed the limit."}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_b50d15ea","line":128,"updated":"2017-02-23 13:43:00.000000000","message":"not related to this change: i like to add the message why this request is a *bad request*","commit_id":"cb17eed88b4827aed00ae9e0140d3046cacd6b4f"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"fb48740fc5dd90d5ec1c50dee8fd82df3bb8762a","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                # Do not exceed the limit."},{"line_number":132,"context_line":"                if len(excl_ctrs.split(\u0027/\u0027)) \u003e self.excl_ctrs_limit:"},{"line_number":133,"context_line":"                    return HTTPBadRequest("},{"line_number":134,"context_line":"                        body\u003d\u0027You may not exclude more than %d\u0027"},{"line_number":135,"context_line":"                        \u0027 containers from the account quota.\u0027"},{"line_number":136,"context_line":"                        % self.excl_ctrs_limit)(env, start_response)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"                # Store list in sysmeta to prevent that a non-reseller"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_551699f1","line":135,"range":{"start_line":134,"start_character":24,"end_line":135,"end_character":61},"updated":"2017-02-23 13:43:00.000000000","message":"Nice!!! this is helpful!","commit_id":"cb17eed88b4827aed00ae9e0140d3046cacd6b4f"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"747196255f96971a75caf49a958900ffcd93c3ab","unresolved":false,"context_lines":[{"line_number":29,"context_line":"requests to these containers will ignore the quota mechanism, and the total"},{"line_number":30,"context_line":"size of these containers will be substracted from the current bytes used of"},{"line_number":31,"context_line":"the account for requests to other containers."},{"line_number":32,"context_line":"To prevent performance hampering, it is configurable to set a maximum"},{"line_number":33,"context_line":"list length for the excluded containers, with the configuration option"},{"line_number":34,"context_line":"``exclude_containers_limit``. If not specified, this limit will default to 10."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"The ``account_quotas`` middleware should be added to the pipeline in your"},{"line_number":37,"context_line":"``/etc/swift/proxy-server.conf`` file just after any auth middleware."}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_875b2ef4","line":34,"range":{"start_line":32,"start_character":0,"end_line":34,"end_character":78},"updated":"2017-06-06 02:28:39.000000000","message":"I\u0027d like to make this block as Note to highlight the performance problem on each PUT if many containers are set as exclude container. Likely\n\n.. note::\n    The operation setting many container as excluded may make performance degradation.\n    To prevent performance hampering, it is configurable to set a maximum list length\n    for the excluded containers, with the configuration option\n    ``exclude_containers_limit``. If not specified, this limit will default to 10\n\n\nAnd with this constraint, I like to make the maximum number limits to 0 in default. I suppose Tim has his opinion too though.","commit_id":"05a832f67413922f226ddfa13864cd522fb91b2a"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"747196255f96971a75caf49a958900ffcd93c3ab","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        excl_ctrs \u003d account_info[\u0027sysmeta\u0027].get(\u0027quota-exclude-containers\u0027)"},{"line_number":163,"context_line":"        excl_size \u003d 0"},{"line_number":164,"context_line":"        for exctr in excl_ctrs.split(\u0027/\u0027) if excl_ctrs else []:"},{"line_number":165,"context_line":"            # Do not consider quota inside these containers."},{"line_number":166,"context_line":"            if container \u003d\u003d exctr:"},{"line_number":167,"context_line":"                return self.app"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"            container_info \u003d get_info("},{"line_number":170,"context_line":"                self.app, request.environ, account, exctr)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_ceda7a76","line":167,"range":{"start_line":164,"start_character":0,"end_line":167,"end_character":31},"updated":"2017-06-06 02:28:39.000000000","message":"Probably\n\n exclude_containers \u003d excl_ctrs.split(\u0027/\u0027) if excl_ctrs else []\n if container in exclude_containers:\n   return self.app\n else:\n   for exctr in exclude_containers:\n     container_info \u003d get_info(self.app, request.environ, account, exctr)\n     if container_info:\n       excl_size +\u003d container_info[\u0027bytes\u0027]\n\nis better?\n\nThat is because we can avoid redundant (and cost) get_info calls if the container is included in exclude_containers, isn\u0027t it?","commit_id":"05a832f67413922f226ddfa13864cd522fb91b2a"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"38e5c36c69e46ba77bf8559a3d6f1b5cdf9f0ddc","unresolved":false,"context_lines":[{"line_number":24,"context_line":"set."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Beyond that, it is possible for a reseller to add a ``/``-delimited list"},{"line_number":27,"context_line":"of containers with the ``x-account-quota-exclude-containers`` metadata"},{"line_number":28,"context_line":"header, which should be excluded from the quota mechanism. (PUT, POST)"},{"line_number":29,"context_line":"requests to these containers will ignore the quota mechanism, and the total"},{"line_number":30,"context_line":"size of these containers will be substracted from the current bytes used of"}],"source_content_type":"text/x-python","patch_set":5,"id":"df140735_3068f01f","line":27,"updated":"2017-06-07 06:14:43.000000000","message":"Er - OK. When I tried to the final testing in my living environment, I wondered why the syntax is different from x-account-meta-quota-bytes (use -meta- in the header) but it was from Tim\u0027s comment that x-account-quota-exclude-containers should be only for deployers so it seems ok to me.\n\nPerhaps, in the future work, we may want to change x-account-meta-quota-bytes to x-account-quota-bytes but it should be absolutely another patch.\n\nSo no matter exists right now using x-account-quota-exclude-containers header.\n\nNice.","commit_id":"dae58221a12c3e08479188b0b49292db9486cd74"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"38e5c36c69e46ba77bf8559a3d6f1b5cdf9f0ddc","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        if quota \u003c 0:"},{"line_number":165,"context_line":"            return self.app"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        excl_ctrs \u003d (lambda s: [] if s is None else s.split(\u0027/\u0027))("},{"line_number":168,"context_line":"            account_info[\u0027sysmeta\u0027].get(\u0027quota-exclude-containers\u0027))"},{"line_number":169,"context_line":"        excl_size \u003d 0"},{"line_number":170,"context_line":"        if container in excl_ctrs:"},{"line_number":171,"context_line":"            # Do not consider quota inside these containers."}],"source_content_type":"text/x-python","patch_set":5,"id":"df140735_8d5a0381","line":168,"range":{"start_line":167,"start_character":0,"end_line":168,"end_character":68},"updated":"2017-06-07 06:14:43.000000000","message":"excl_ctrs \u003d [\n    ex_con for ex_con in \n    account_info[\u0027sysmeta\u0027].get(\u0027quota-exclude-containers\u0027, \u0027\u0027).split(\u0027/\u0027)\n    if ex_con]","commit_id":"dae58221a12c3e08479188b0b49292db9486cd74"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"75f824b1c9214f7d942e2fa90d52b3bb154dff37","unresolved":false,"context_lines":[{"line_number":29,"context_line":"requests to these containers will ignore the quota mechanism, and the total"},{"line_number":30,"context_line":"size of these containers will be substracted from the current bytes used of"},{"line_number":31,"context_line":"the account for requests to other containers."},{"line_number":32,"context_line":".. note::"},{"line_number":33,"context_line":"    Setting many containers as excluded may lead to a performance"},{"line_number":34,"context_line":"    degradation, because each (PUT, POST) request to a non-excluded container"},{"line_number":35,"context_line":"    results in a retrieval of usage information of ALL excluded containers."}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_a6c4aa41","line":32,"updated":"2017-06-07 20:07:59.000000000","message":"I think we need another newline here; this note isn\u0027t formatting well: http://docs-draft.openstack.org/32/414232/6/check/gate-swift-docs-ubuntu-xenial/b2772b2//doc/build/html/middleware.html#module-swift.common.middleware.account_quotas","commit_id":"2b9ad188cf0fac7e856d9a9a2a12d23dba44e7f4"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"75f824b1c9214f7d942e2fa90d52b3bb154dff37","unresolved":false,"context_lines":[{"line_number":31,"context_line":"the account for requests to other containers."},{"line_number":32,"context_line":".. note::"},{"line_number":33,"context_line":"    Setting many containers as excluded may lead to a performance"},{"line_number":34,"context_line":"    degradation, because each (PUT, POST) request to a non-excluded container"},{"line_number":35,"context_line":"    results in a retrieval of usage information of ALL excluded containers."},{"line_number":36,"context_line":"    To prevent performance hampering, it is configurable to set a maximum list"},{"line_number":37,"context_line":"    length for the excluded containers, with the configuration option"}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_a6ab8a73","line":34,"range":{"start_line":34,"start_character":36,"end_line":34,"end_character":40},"updated":"2017-06-07 20:07:59.000000000","message":"Is that accurate? I wasn\u0027t expecting POST requests to be impacted -- isn\u0027t that why we early-return at L153 before doing any container_info requests?","commit_id":"2b9ad188cf0fac7e856d9a9a2a12d23dba44e7f4"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"a763bd8f0aa6aba831fa5d1a0b97c7f65efd60e4","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    Setting many containers as excluded may lead to a performance"},{"line_number":34,"context_line":"    degradation, because each (PUT, POST) request to a non-excluded container"},{"line_number":35,"context_line":"    results in a retrieval of usage information of ALL excluded containers."},{"line_number":36,"context_line":"    To prevent performance hampering, it is configurable to set a maximum list"},{"line_number":37,"context_line":"    length for the excluded containers, with the configuration option"},{"line_number":38,"context_line":"    ``exclude_containers_limit``."},{"line_number":39,"context_line":"    If not specified, this limit will default to 0."}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_e3b0548e","line":36,"range":{"start_line":36,"start_character":44,"end_line":36,"end_character":56},"updated":"2017-06-07 19:54:57.000000000","message":"recommended?","commit_id":"2b9ad188cf0fac7e856d9a9a2a12d23dba44e7f4"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"a763bd8f0aa6aba831fa5d1a0b97c7f65efd60e4","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    @wsgify"},{"line_number":94,"context_line":"    def __call__(self, request):"},{"line_number":95,"context_line":"        if (request.method in (\u0027GET\u0027, \u0027HEAD\u0027) and"},{"line_number":96,"context_line":"                request.environ.get(\u0027reseller_request\u0027) is True):"},{"line_number":97,"context_line":"            resp \u003d request.get_response(self.app)"},{"line_number":98,"context_line":"            excl_ctrs_hdr \u003d resp.headers.pop(SYSMETA_EXCL_CTRS_HDR)"},{"line_number":99,"context_line":"            if excl_ctrs_hdr:"}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_66833258","line":96,"range":{"start_line":96,"start_character":16,"end_line":96,"end_character":63},"updated":"2017-06-07 19:54:57.000000000","message":"I understand making the settting of the header be reseller only, but why is it important to also for the GET/HEAD requests? Wouldn\u0027t it be useful for other users to know that certain containers won\u0027t count against their quotas?\n\nFor example, the quotas themselves are also only settable by reseller, but can be viewed by regular users","commit_id":"2b9ad188cf0fac7e856d9a9a2a12d23dba44e7f4"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"a763bd8f0aa6aba831fa5d1a0b97c7f65efd60e4","unresolved":false,"context_lines":[{"line_number":180,"context_line":"                if container_info:"},{"line_number":181,"context_line":"                    excl_size +\u003d container_info[\u0027bytes\u0027]"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        new_size \u003d int(account_info[\u0027bytes\u0027]) + content_length - excl_size"},{"line_number":184,"context_line":"        if quota \u003c new_size:"},{"line_number":185,"context_line":"            resp \u003d HTTPRequestEntityTooLarge(body\u003d\u0027Upload exceeds quota.\u0027)"},{"line_number":186,"context_line":"            if \u0027swift.authorize\u0027 in request.environ:"}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_23452c71","line":183,"range":{"start_line":183,"start_character":23,"end_line":183,"end_character":44},"updated":"2017-06-07 19:54:57.000000000","message":"how does bytes or quota-bytes info get bubbled up to the account_info again?? couldn\u0027t we just use the same mechanism to calculate the excl_size?","commit_id":"2b9ad188cf0fac7e856d9a9a2a12d23dba44e7f4"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"75f824b1c9214f7d942e2fa90d52b3bb154dff37","unresolved":false,"context_lines":[{"line_number":180,"context_line":"                if container_info:"},{"line_number":181,"context_line":"                    excl_size +\u003d container_info[\u0027bytes\u0027]"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        new_size \u003d int(account_info[\u0027bytes\u0027]) + content_length - excl_size"},{"line_number":184,"context_line":"        if quota \u003c new_size:"},{"line_number":185,"context_line":"            resp \u003d HTTPRequestEntityTooLarge(body\u003d\u0027Upload exceeds quota.\u0027)"},{"line_number":186,"context_line":"            if \u0027swift.authorize\u0027 in request.environ:"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf091321_b81bd971","line":183,"range":{"start_line":183,"start_character":23,"end_line":183,"end_character":44},"in_reply_to":"df140735_23452c71","updated":"2017-06-07 20:07:59.000000000","message":"That\u0027s coming out of the account metadata, by way of proxy/controllers/base.py [1] -- I think this is the appropriate place to do this accounting.\n\n[1] https://github.com/openstack/swift/blob/2.14.0/swift/proxy/controllers/base.py#L132-L152","commit_id":"2b9ad188cf0fac7e856d9a9a2a12d23dba44e7f4"}],"test/unit/common/middleware/test_account_quotas.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"202f07b9a6e668d61c16c2042f3d12d2cb78da5a","unresolved":false,"context_lines":[{"line_number":450,"context_line":"                            environ\u003d{\u0027swift.cache\u0027: cache})"},{"line_number":451,"context_line":"        res \u003d req.get_response(app)"},{"line_number":452,"context_line":"        self.assertEqual(res.status_int, 200)"},{"line_number":453,"context_line":""},{"line_number":454,"context_line":""},{"line_number":455,"context_line":"class AccountQuotaCopyingTestCases(unittest.TestCase):"},{"line_number":456,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a3c09a3_86952588","line":453,"updated":"2017-01-17 18:45:56.000000000","message":"I\u0027d like to see some test coverage for setting the excluded containers, in particular verifying that normal users can\u0027t set it while resellers can.","commit_id":"448eab42f5cd733bd8cd1197c2a7dc1a65912380"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"fb48740fc5dd90d5ec1c50dee8fd82df3bb8762a","unresolved":false,"context_lines":[{"line_number":455,"context_line":"        env \u003d {"},{"line_number":456,"context_line":"            \u0027swift.cache\u0027: cache,"},{"line_number":457,"context_line":"            \u0027reseller_request\u0027: True,"},{"line_number":458,"context_line":"            header_to_environ_key(account_quotas.EXCL_CTRS_HDR):"},{"line_number":459,"context_line":"            \u0027exc1/exc2\u0027}"},{"line_number":460,"context_line":"        req \u003d Request.blank(\u0027/v1/a/\u0027, method\u003d\u0027PUT\u0027, environ\u003denv)"},{"line_number":461,"context_line":"        res \u003d req.get_response(app)"},{"line_number":462,"context_line":"        self.assertEqual(res.status_int, 200)"},{"line_number":463,"context_line":"        self.assertIn(account_quotas.SYSMETA_EXCL_CTRS_HDR,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_1a028e3d","line":460,"range":{"start_line":458,"start_character":2,"end_line":460,"end_character":64},"updated":"2017-02-23 13:43:00.000000000","message":"just a question, why not using headers keyword args?","commit_id":"cb17eed88b4827aed00ae9e0140d3046cacd6b4f"},{"author":{"_account_id":17245,"name":"Christopher Bartz","email":"bartz@dkrz.de","username":"cbartz"},"change_message_id":"446db0af834ec34baf6ca9dd2d9bb1d66722a7c7","unresolved":false,"context_lines":[{"line_number":455,"context_line":"        env \u003d {"},{"line_number":456,"context_line":"            \u0027swift.cache\u0027: cache,"},{"line_number":457,"context_line":"            \u0027reseller_request\u0027: True,"},{"line_number":458,"context_line":"            header_to_environ_key(account_quotas.EXCL_CTRS_HDR):"},{"line_number":459,"context_line":"            \u0027exc1/exc2\u0027}"},{"line_number":460,"context_line":"        req \u003d Request.blank(\u0027/v1/a/\u0027, method\u003d\u0027PUT\u0027, environ\u003denv)"},{"line_number":461,"context_line":"        res \u003d req.get_response(app)"},{"line_number":462,"context_line":"        self.assertEqual(res.status_int, 200)"},{"line_number":463,"context_line":"        self.assertIn(account_quotas.SYSMETA_EXCL_CTRS_HDR,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_ca0b9f22","line":460,"range":{"start_line":458,"start_character":2,"end_line":460,"end_character":64},"in_reply_to":"da36d5c6_1a028e3d","updated":"2017-02-24 08:56:50.000000000","message":"Could also be done with headers. I think I was just using the same style as the other methods (which only use environ kwarg).","commit_id":"cb17eed88b4827aed00ae9e0140d3046cacd6b4f"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"fb48740fc5dd90d5ec1c50dee8fd82df3bb8762a","unresolved":false,"context_lines":[{"line_number":485,"context_line":"            header_to_environ_key(account_quotas.EXCL_CTRS_HDR): \u0027exc1/exc2\u0027}"},{"line_number":486,"context_line":"        req \u003d Request.blank(\u0027/v1/a/\u0027, method\u003d\u0027PUT\u0027, environ\u003denv)"},{"line_number":487,"context_line":"        res \u003d req.get_response(app)"},{"line_number":488,"context_line":"        self.assertEqual(res.status_int, 400)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def test_exclude_containers_reseller_GET(self):"},{"line_number":491,"context_line":"        headers \u003d [(account_quotas.SYSMETA_EXCL_CTRS_HDR, \u0027exc1\u0027)]"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_fa605a03","line":488,"updated":"2017-02-23 13:43:00.000000000","message":"is it worth to add the assertion for error response message?\nAh... it looks like some test cases don\u0027t assert them though...:/","commit_id":"cb17eed88b4827aed00ae9e0140d3046cacd6b4f"},{"author":{"_account_id":17245,"name":"Christopher Bartz","email":"bartz@dkrz.de","username":"cbartz"},"change_message_id":"446db0af834ec34baf6ca9dd2d9bb1d66722a7c7","unresolved":false,"context_lines":[{"line_number":485,"context_line":"            header_to_environ_key(account_quotas.EXCL_CTRS_HDR): \u0027exc1/exc2\u0027}"},{"line_number":486,"context_line":"        req \u003d Request.blank(\u0027/v1/a/\u0027, method\u003d\u0027PUT\u0027, environ\u003denv)"},{"line_number":487,"context_line":"        res \u003d req.get_response(app)"},{"line_number":488,"context_line":"        self.assertEqual(res.status_int, 400)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def test_exclude_containers_reseller_GET(self):"},{"line_number":491,"context_line":"        headers \u003d [(account_quotas.SYSMETA_EXCL_CTRS_HDR, \u0027exc1\u0027)]"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_4ab96f14","line":488,"in_reply_to":"da36d5c6_fa605a03","updated":"2017-02-24 08:56:50.000000000","message":"True, its better with an assertion.","commit_id":"cb17eed88b4827aed00ae9e0140d3046cacd6b4f"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"747196255f96971a75caf49a958900ffcd93c3ab","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                env[\u0027PATH_INFO\u0027] \u003d\u003d \u0027/v1/a/c2/o2\u0027:"},{"line_number":60,"context_line":"            cache_key \u003d get_cache_key(\u0027a\u0027, \u0027c2\u0027, \u0027o2\u0027)"},{"line_number":61,"context_line":"            env.setdefault(\u0027swift.infocache\u0027, {})[cache_key] \u003d \\"},{"line_number":62,"context_line":"                headers_to_object_info(self.headers, 200)"},{"line_number":63,"context_line":"            start_response(\u0027200 OK\u0027, self.headers)"},{"line_number":64,"context_line":"        elif env[\u0027REQUEST_METHOD\u0027] \u003d\u003d \"HEAD\" and \\"},{"line_number":65,"context_line":"                env[\u0027PATH_INFO\u0027].startswith(\u0027/v1/a/exc\u0027):"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_f0476176","line":62,"range":{"start_line":62,"start_character":39,"end_line":62,"end_character":50},"updated":"2017-06-06 02:28:39.000000000","message":"Off-Topic: I\u0027m getting feeling self.headers can be abused here because self.headers is defined when FakeApp initialized but the callers looks to assume the headers are used for GET account (i.e. they set something like x-account-bytes-used) but here, actually it will be included in object HEAD response.","commit_id":"05a832f67413922f226ddfa13864cd522fb91b2a"},{"author":{"_account_id":17245,"name":"Christopher Bartz","email":"bartz@dkrz.de","username":"cbartz"},"change_message_id":"55f73a0a400a01dab08c83030a3b3b9a21a1b2ce","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                env[\u0027PATH_INFO\u0027] \u003d\u003d \u0027/v1/a/c2/o2\u0027:"},{"line_number":60,"context_line":"            cache_key \u003d get_cache_key(\u0027a\u0027, \u0027c2\u0027, \u0027o2\u0027)"},{"line_number":61,"context_line":"            env.setdefault(\u0027swift.infocache\u0027, {})[cache_key] \u003d \\"},{"line_number":62,"context_line":"                headers_to_object_info(self.headers, 200)"},{"line_number":63,"context_line":"            start_response(\u0027200 OK\u0027, self.headers)"},{"line_number":64,"context_line":"        elif env[\u0027REQUEST_METHOD\u0027] \u003d\u003d \"HEAD\" and \\"},{"line_number":65,"context_line":"                env[\u0027PATH_INFO\u0027].startswith(\u0027/v1/a/exc\u0027):"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_a067334d","line":62,"range":{"start_line":62,"start_character":39,"end_line":62,"end_character":50},"in_reply_to":"df140735_f0476176","updated":"2017-06-06 09:02:31.000000000","message":"This path is used in the CopyingTestCases, and the caller uses the headers for account and object information (e.g. x-account-bytes-used and content-length). headers_to_object_info does ignore the x-account* headers, so from my point of view, it is currently safe to do so. But, it is questionable if the code breaks in the future (if the internal behaviour of headers_to_object_info changes).","commit_id":"05a832f67413922f226ddfa13864cd522fb91b2a"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"747196255f96971a75caf49a958900ffcd93c3ab","unresolved":false,"context_lines":[{"line_number":98,"context_line":"class TestAccountQuota(unittest.TestCase):"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def setUp(self):"},{"line_number":101,"context_line":"        self.app \u003d ("},{"line_number":102,"context_line":"            lambda headers:"},{"line_number":103,"context_line":"            account_quotas.AccountQuotaMiddleware(FakeApp(headers), {}))"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def test_unauthorized(self):"},{"line_number":106,"context_line":"        headers \u003d [(\u0027x-account-bytes-used\u0027, \u00271000\u0027), ]"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_9df27e99","line":103,"range":{"start_line":101,"start_character":0,"end_line":103,"end_character":72},"updated":"2017-06-06 02:28:39.000000000","message":"I don\u0027t like this kind of change because self.app is not an app but a generator with the headers arg here. Plus that *app* is far from swift *app* context. Furthermore, this abstraction seems to blind us what is changed for the code  IMO.\n\nSo why not just adding the new *conf* arg as empty for each line?\n\ne.g. (at L94 in old code)\n - app \u003d account_quotas.AccountQuotaMiddleware(FakeApp(headers))\n + app \u003d account_quotas.AccountQuotaMiddleware(FakeApp(headers), {})\n\nIf we do like that, that diff explicitly says that we need a new arg for AccountQuotaMiddlewre and this test sets it as empty.","commit_id":"05a832f67413922f226ddfa13864cd522fb91b2a"},{"author":{"_account_id":17245,"name":"Christopher Bartz","email":"bartz@dkrz.de","username":"cbartz"},"change_message_id":"55f73a0a400a01dab08c83030a3b3b9a21a1b2ce","unresolved":false,"context_lines":[{"line_number":98,"context_line":"class TestAccountQuota(unittest.TestCase):"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def setUp(self):"},{"line_number":101,"context_line":"        self.app \u003d ("},{"line_number":102,"context_line":"            lambda headers:"},{"line_number":103,"context_line":"            account_quotas.AccountQuotaMiddleware(FakeApp(headers), {}))"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def test_unauthorized(self):"},{"line_number":106,"context_line":"        headers \u003d [(\u0027x-account-bytes-used\u0027, \u00271000\u0027), ]"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_00e37fa5","line":103,"range":{"start_line":101,"start_character":0,"end_line":103,"end_character":72},"in_reply_to":"df140735_9df27e99","updated":"2017-06-06 09:02:31.000000000","message":"Ok, my intention was to not repeat code. But I understand that the diff is faster understandable with the explicit lines.","commit_id":"05a832f67413922f226ddfa13864cd522fb91b2a"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"747196255f96971a75caf49a958900ffcd93c3ab","unresolved":false,"context_lines":[{"line_number":404,"context_line":"        req \u003d Request.blank(\u0027/v1/a/c/o\u0027, method\u003d\u0027PUT\u0027,"},{"line_number":405,"context_line":"                            environ\u003d{\u0027swift.cache\u0027: cache})"},{"line_number":406,"context_line":"        res \u003d req.get_response(self.app(headers))"},{"line_number":407,"context_line":"        self.assertEqual(res.status_int, 200)"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"    def test_exclude_containers_exceed_quota(self):"},{"line_number":410,"context_line":"        headers \u003d [(\u0027x-account-bytes-used\u0027, \u00271002\u0027),"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_13d09fc8","line":407,"updated":"2017-06-06 02:28:39.000000000","message":"got it. L65-L72 changes are needed for this. The containers that have \"exc\" prefix shows 1 bytes used and AccountQuota middleware decreases the bytes from total used bytes in the account metadata.\n\nOff-topic)\nThe interesting point is we can push 0 bytes object even the used bytes equals to the quota :/","commit_id":"05a832f67413922f226ddfa13864cd522fb91b2a"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"747196255f96971a75caf49a958900ffcd93c3ab","unresolved":false,"context_lines":[{"line_number":416,"context_line":"        res \u003d req.get_response(self.app(headers))"},{"line_number":417,"context_line":"        self.assertEqual(res.status_int, 413)"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"    def test_exclude_containers_inside_exclude_container(self):"},{"line_number":420,"context_line":"        headers \u003d [(\u0027x-account-bytes-used\u0027, \u00271000\u0027),"},{"line_number":421,"context_line":"                   (\u0027x-account-meta-quota-bytes\u0027, \u00270\u0027),"},{"line_number":422,"context_line":"                   (account_quotas.SYSMETA_EXCL_CTRS_HDR, \u0027exc1\u0027)]"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_336963f8","line":419,"updated":"2017-06-06 02:28:39.000000000","message":"nits) something like test_put_object_to_exclude_container_exceeds_quota?","commit_id":"05a832f67413922f226ddfa13864cd522fb91b2a"},{"author":{"_account_id":17245,"name":"Christopher Bartz","email":"bartz@dkrz.de","username":"cbartz"},"change_message_id":"55f73a0a400a01dab08c83030a3b3b9a21a1b2ce","unresolved":false,"context_lines":[{"line_number":416,"context_line":"        res \u003d req.get_response(self.app(headers))"},{"line_number":417,"context_line":"        self.assertEqual(res.status_int, 413)"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"    def test_exclude_containers_inside_exclude_container(self):"},{"line_number":420,"context_line":"        headers \u003d [(\u0027x-account-bytes-used\u0027, \u00271000\u0027),"},{"line_number":421,"context_line":"                   (\u0027x-account-meta-quota-bytes\u0027, \u00270\u0027),"},{"line_number":422,"context_line":"                   (account_quotas.SYSMETA_EXCL_CTRS_HDR, \u0027exc1\u0027)]"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_2048c32a","line":419,"in_reply_to":"df140735_336963f8","updated":"2017-06-06 09:02:31.000000000","message":"I like to set the prefix exclude_containers, so that it is quickly seen that the test refers to this particular feature.","commit_id":"05a832f67413922f226ddfa13864cd522fb91b2a"}]}
