)]}'
{"swift/account/utils.py":[{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6961b015b43fce82653224de097f50e889f405d7","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        return {}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def get_response_headers(broker, logger\u003dNone):"},{"line_number":49,"context_line":"    info \u003d broker.get_info()"},{"line_number":50,"context_line":"    resp_headers \u003d {"},{"line_number":51,"context_line":"        \u0027X-Account-Container-Count\u0027: info[\u0027container_count\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_2fe216a0","line":48,"updated":"2015-02-11 22:37:45.000000000","message":"But broker always has a logger, so why is it necessary to pass a different logger?\n\nObviously it\u0027s still needed to set that in FakeAccountBroker().","commit_id":"4c68777585bd463ffd38703edfedd93676afac95"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"b064708e80a6fb9c899d4569c7b659525e5af95b","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        return {}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def get_response_headers(broker, logger\u003dNone):"},{"line_number":49,"context_line":"    info \u003d broker.get_info()"},{"line_number":50,"context_line":"    resp_headers \u003d {"},{"line_number":51,"context_line":"        \u0027X-Account-Container-Count\u0027: info[\u0027container_count\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_9106c51a","line":48,"in_reply_to":"da86d52c_2fe216a0","updated":"2015-02-12 01:32:13.000000000","message":"Thanks. I re-checked my code and as you said it might be unnecessary to pass a logger. I will do a test again without passing a logger.","commit_id":"4c68777585bd463ffd38703edfedd93676afac95"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"b58e54c299e37bf8c2d4edc90fe17ec20b9e994c","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        return {}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def get_response_headers(broker, logger\u003dNone):"},{"line_number":49,"context_line":"    info \u003d broker.get_info()"},{"line_number":50,"context_line":"    resp_headers \u003d {"},{"line_number":51,"context_line":"        \u0027X-Account-Container-Count\u0027: info[\u0027container_count\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_d7e648af","line":48,"in_reply_to":"da86d52c_9106c51a","updated":"2015-02-12 18:42:15.000000000","message":"I investigated the code more deeply and did tests. The case that broker is an instance of FakeAccountBroker is only when proxy sends a GET request if account_autocreate setting is true and the real account DB is not found. That means the content list of an account is empty.\n\nTherefore, we do not have to pass logger if broker is an instance of FakeAccountBroker because there is no chance to leave logging \u0027policy not found\u0027.","commit_id":"4c68777585bd463ffd38703edfedd93676afac95"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"09d74c0d4bc7be288b74479934f4f98450898c69","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    for policy_idx, stats in policy_stats.items():"},{"line_number":59,"context_line":"        policy \u003d POLICIES.get_by_index(policy_idx)"},{"line_number":60,"context_line":"        if not policy:"},{"line_number":61,"context_line":"            if broker.logger:"},{"line_number":62,"context_line":"                broker.logger.error(\u0027No policy with index %r\u0027 % policy_idx)"},{"line_number":63,"context_line":"            continue"},{"line_number":64,"context_line":"        header_prefix \u003d \u0027X-Account-Storage-Policy-%s-%%s\u0027 % policy.name"}],"source_content_type":"text/x-python","patch_set":9,"id":"bae84128_72b34b0b","line":61,"updated":"2016-02-25 04:35:55.000000000","message":"broker instance always have logger instance[1], right?\n\n1: https://github.com/openstack/swift/blob/master/swift/common/db.py#L211","commit_id":"c789d50ec955fe8859c4657efe958513fd499257"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"ee0989a1e0f90c879c3314a47d221b6943fa38ae","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    for policy_idx, stats in policy_stats.items():"},{"line_number":59,"context_line":"        policy \u003d POLICIES.get_by_index(policy_idx)"},{"line_number":60,"context_line":"        if not policy:"},{"line_number":61,"context_line":"            if broker.logger:"},{"line_number":62,"context_line":"                broker.logger.error(\u0027No policy with index %r\u0027 % policy_idx)"},{"line_number":63,"context_line":"            continue"},{"line_number":64,"context_line":"        header_prefix \u003d \u0027X-Account-Storage-Policy-%s-%%s\u0027 % policy.name"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aed3d3a_590547ba","line":61,"in_reply_to":"bae84128_72b34b0b","updated":"2016-02-27 03:19:38.000000000","message":"Thanks.","commit_id":"c789d50ec955fe8859c4657efe958513fd499257"}],"swift/common/request_helpers.py":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"424ff6e298b067cd8646d5fcc6496890c0e0f99e","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"def get_name_and_placement(request, minsegs\u003d1, maxsegs\u003dNone,"},{"line_number":85,"context_line":"                           rest_with_last\u003dFalse, logger\u003dNone):"},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":"    Utility function to split and validate the request path and storage"},{"line_number":88,"context_line":"    policy.  The storage policy index is extracted from the headers of"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_362ac230","line":85,"updated":"2015-06-26 05:36:16.000000000","message":"It might be only me but I don\u0027t like to pass a logger instance to a outside function because it\u0027s hard to maintain the actual instance should be set to this.\n\nIf you want add logging handling to controllers, the way to attach inner method something like _get_name_and_placement into base controller class and then handling get_name_and_placement response seems better to me.\n\ne.g.:\n\n\n class Controller(object):\n   def _get_name_and_placement(request, minsegs\u003d1, maxsegs\u003dNone, rest_with_last\u003dFalse):\n     try:\n       results \u003d get_name_and_placement(request, minsegs, maxsegs, rest_with_last)\n     except:\n       self.logger.error(\u0027something\u0027)\n       raise\n     return results","commit_id":"3da43fa5b3f582cebc22e999d394d972547dd49a"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"b7b80290c7d131466ea76d729f0673b5e469263e","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"def get_name_and_placement(request, minsegs\u003d1, maxsegs\u003dNone,"},{"line_number":85,"context_line":"                           rest_with_last\u003dFalse, logger\u003dNone):"},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":"    Utility function to split and validate the request path and storage"},{"line_number":88,"context_line":"    policy.  The storage policy index is extracted from the headers of"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_6061e838","line":85,"in_reply_to":"fa32b979_362ac230","updated":"2015-08-11 15:16:15.000000000","message":"Thanks. I also think your suggestion is very good because this can avoid not only passing logger as argument but also code duplication.","commit_id":"3da43fa5b3f582cebc22e999d394d972547dd49a"}],"swift/container/server.py":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"09d74c0d4bc7be288b74479934f4f98450898c69","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        try:"},{"line_number":149,"context_line":"            policy_index \u003d int(policy_index)"},{"line_number":150,"context_line":"        except ValueError:"},{"line_number":151,"context_line":"            self.logger.error(\u0027No policy with index %r\u0027 % policy_index)"},{"line_number":152,"context_line":"            raise HTTPBadRequest("},{"line_number":153,"context_line":"                request\u003dreq, content_type\u003d\"text/plain\","},{"line_number":154,"context_line":"                body\u003d(\"Invalid X-Storage-Policy-Index %r\" % policy_index))"}],"source_content_type":"text/x-python","patch_set":9,"id":"bae84128_1208ff90","line":151,"updated":"2016-02-25 04:35:55.000000000","message":"Hmm....I\u0027m not sure if it\u0027s good to log as an error for this. The information looks good to know for operators but I\u0027m afraid a bunch of errors logged in some cases like while deploying a new policy even if it\u0027s intended.\n\nSeems like just *debug* is enough. Thought?","commit_id":"c789d50ec955fe8859c4657efe958513fd499257"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"ee0989a1e0f90c879c3314a47d221b6943fa38ae","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        try:"},{"line_number":149,"context_line":"            policy_index \u003d int(policy_index)"},{"line_number":150,"context_line":"        except ValueError:"},{"line_number":151,"context_line":"            self.logger.error(\u0027No policy with index %r\u0027 % policy_index)"},{"line_number":152,"context_line":"            raise HTTPBadRequest("},{"line_number":153,"context_line":"                request\u003dreq, content_type\u003d\"text/plain\","},{"line_number":154,"context_line":"                body\u003d(\"Invalid X-Storage-Policy-Index %r\" % policy_index))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aed3d3a_992d0f49","line":151,"in_reply_to":"bae84128_1208ff90","updated":"2016-02-27 03:19:38.000000000","message":"Thanks for your suggestion. I reconsider it and I can totally agree your comment.","commit_id":"c789d50ec955fe8859c4657efe958513fd499257"}],"swift/obj/server.py":[{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"e1e561571b38ac74b2e84a2e85d7be9fd4a5c4ba","unresolved":false,"context_lines":[{"line_number":530,"context_line":"        except DiskFileDeviceUnavailable:"},{"line_number":531,"context_line":"            return HTTPInsufficientStorage(drive\u003ddevice, request\u003drequest)"},{"line_number":532,"context_line":"        except PolicyError as e:"},{"line_number":533,"context_line":"            self.logger.error(e)"},{"line_number":534,"context_line":"            return HTTPInternalServerError(request\u003drequest,"},{"line_number":535,"context_line":"                                           content_type\u003d\"text/plain\","},{"line_number":536,"context_line":"                                           body\u003dstr(e))"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_fe8430b2","line":533,"updated":"2015-01-15 21:20:58.000000000","message":"new uncovered code","commit_id":"01026a68959e8bef3e17032a3640cb36c9d4e4d4"},{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"e1e561571b38ac74b2e84a2e85d7be9fd4a5c4ba","unresolved":false,"context_lines":[{"line_number":585,"context_line":"        except DiskFileDeviceUnavailable:"},{"line_number":586,"context_line":"            return HTTPInsufficientStorage(drive\u003ddevice, request\u003drequest)"},{"line_number":587,"context_line":"        except PolicyError as e:"},{"line_number":588,"context_line":"            self.logger.error(e)"},{"line_number":589,"context_line":"            return HTTPInternalServerError(request\u003drequest,"},{"line_number":590,"context_line":"                                           content_type\u003d\"text/plain\","},{"line_number":591,"context_line":"                                           body\u003dstr(e))"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_5ebb8474","line":588,"updated":"2015-01-15 21:20:58.000000000","message":"new uncovered code","commit_id":"01026a68959e8bef3e17032a3640cb36c9d4e4d4"},{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"e1e561571b38ac74b2e84a2e85d7be9fd4a5c4ba","unresolved":false,"context_lines":[{"line_number":633,"context_line":"        except DiskFileDeviceUnavailable:"},{"line_number":634,"context_line":"            return HTTPInsufficientStorage(drive\u003ddevice, request\u003drequest)"},{"line_number":635,"context_line":"        except PolicyError as e:"},{"line_number":636,"context_line":"            self.logger.error(e)"},{"line_number":637,"context_line":"            return HTTPInternalServerError(request\u003drequest,"},{"line_number":638,"context_line":"                                           content_type\u003d\"text/plain\","},{"line_number":639,"context_line":"                                           body\u003dstr(e))"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_1ea57c47","line":636,"updated":"2015-01-15 21:20:58.000000000","message":"new uncovered code","commit_id":"01026a68959e8bef3e17032a3640cb36c9d4e4d4"},{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"e1e561571b38ac74b2e84a2e85d7be9fd4a5c4ba","unresolved":false,"context_lines":[{"line_number":713,"context_line":"        except DiskFileDeviceUnavailable:"},{"line_number":714,"context_line":"            resp \u003d HTTPInsufficientStorage(drive\u003ddevice, request\u003drequest)"},{"line_number":715,"context_line":"        except PolicyError as e:"},{"line_number":716,"context_line":"            self.logger.error(e)"},{"line_number":717,"context_line":"            return HTTPInternalServerError(request\u003drequest,"},{"line_number":718,"context_line":"                                           content_type\u003d\"text/plain\","},{"line_number":719,"context_line":"                                           body\u003dstr(e))"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_7e676025","line":716,"updated":"2015-01-15 21:20:58.000000000","message":"new uncovered code","commit_id":"01026a68959e8bef3e17032a3640cb36c9d4e4d4"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"09d74c0d4bc7be288b74479934f4f98450898c69","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        except HTTPException as e:"},{"line_number":196,"context_line":"            if e.status_int \u003d\u003d 503:"},{"line_number":197,"context_line":"                self.logger.error(e.body)"},{"line_number":198,"context_line":"            raise"},{"line_number":199,"context_line":"        return results"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def get_diskfile(self, device, partition, account, container, obj,"}],"source_content_type":"text/x-python","patch_set":9,"id":"bae84128_32626317","line":198,"updated":"2016-02-25 04:35:55.000000000","message":"Seems like:\n\n except HTTPServiceUnavailable as e:\n   self.logger.error(e.body)\n   raise\n\n\n???","commit_id":"c789d50ec955fe8859c4657efe958513fd499257"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"ee0989a1e0f90c879c3314a47d221b6943fa38ae","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        except HTTPException as e:"},{"line_number":196,"context_line":"            if e.status_int \u003d\u003d 503:"},{"line_number":197,"context_line":"                self.logger.error(e.body)"},{"line_number":198,"context_line":"            raise"},{"line_number":199,"context_line":"        return results"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def get_diskfile(self, device, partition, account, container, obj,"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aed3d3a_f9cd3b5e","line":198,"in_reply_to":"bae84128_32626317","updated":"2016-02-27 03:19:38.000000000","message":"As for swift/common/swob.py, HTTPServiceUnavailable is not class name but instance of HTTPException class whose status_int is 503. That is why I write like above.","commit_id":"c789d50ec955fe8859c4657efe958513fd499257"}],"swift/proxy/controllers/container.py":[{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6961b015b43fce82653224de097f50e889f405d7","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            return"},{"line_number":61,"context_line":"        policy \u003d POLICIES.get_by_name(policy_name)"},{"line_number":62,"context_line":"        if not policy:"},{"line_number":63,"context_line":"            self.app.logger.error("},{"line_number":64,"context_line":"                \u0027Could not translate %s (%r) from %r to policy\u0027,"},{"line_number":65,"context_line":"                \u0027X-Storage-Policy\u0027, policy_name, req.path)"},{"line_number":66,"context_line":"            raise HTTPBadRequest(request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_e241f539","line":63,"updated":"2015-02-11 22:37:45.000000000","message":"I am not sure I like this happening on proxy. The storage nodes, sure, but adding this opens you to useless error messages triggered by clients. Certainly the results are already logged, but once. This multiplies the effect.","commit_id":"4c68777585bd463ffd38703edfedd93676afac95"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"b064708e80a6fb9c899d4569c7b659525e5af95b","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            return"},{"line_number":61,"context_line":"        policy \u003d POLICIES.get_by_name(policy_name)"},{"line_number":62,"context_line":"        if not policy:"},{"line_number":63,"context_line":"            self.app.logger.error("},{"line_number":64,"context_line":"                \u0027Could not translate %s (%r) from %r to policy\u0027,"},{"line_number":65,"context_line":"                \u0027X-Storage-Policy\u0027, policy_name, req.path)"},{"line_number":66,"context_line":"            raise HTTPBadRequest(request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_517a8df1","line":63,"in_reply_to":"da86d52c_e241f539","updated":"2015-02-12 01:32:13.000000000","message":"Hmm... I fully understood what you concerned. OTOH, if this code is not inserted, operators must wait users\u0027 claims to detect proxy-server\u0027s misconfiguration. Therefore, I would like to leave a log in my current thought. Anyway, I can find the side-effect of this code, thanks.","commit_id":"4c68777585bd463ffd38703edfedd93676afac95"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"3e53ca21424b3f5db380252be1ff9aa534cbe50d","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            return"},{"line_number":61,"context_line":"        policy \u003d POLICIES.get_by_name(policy_name)"},{"line_number":62,"context_line":"        if not policy:"},{"line_number":63,"context_line":"            self.app.logger.error("},{"line_number":64,"context_line":"                \u0027Could not translate %s (%r) from %r to policy\u0027,"},{"line_number":65,"context_line":"                \u0027X-Storage-Policy\u0027, policy_name, req.path)"},{"line_number":66,"context_line":"            raise HTTPBadRequest(request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_7f3c8e93","line":63,"updated":"2015-02-12 20:36:55.000000000","message":"I\u0027m still not entirely onboard with outside users triggering logs like these.","commit_id":"20d7c0d1cc21f2eff92bb82a08024fcbf2851f95"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"09d74c0d4bc7be288b74479934f4f98450898c69","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        if not policy:"},{"line_number":65,"context_line":"            self.app.logger.error("},{"line_number":66,"context_line":"                \u0027Could not translate %s (%r) from %r to policy\u0027,"},{"line_number":67,"context_line":"                \u0027X-Storage-Policy\u0027, policy_name, req.path)"},{"line_number":68,"context_line":"            raise HTTPBadRequest(request\u003dreq,"},{"line_number":69,"context_line":"                                 content_type\u003d\"text/plain\","},{"line_number":70,"context_line":"                                 body\u003d(\"Invalid %s \u0027%s\u0027\""}],"source_content_type":"text/x-python","patch_set":9,"id":"bae84128_8dd99486","line":67,"updated":"2016-02-25 04:35:55.000000000","message":"Does this result in the string like \u0027Could not translate X-Storage-Policy (%r) from %r to policy\u0027?\n\nWhy not put \u0027X-Storage-Policy\u0027 string to the first arg?\n\nAnd looks like just \"No policy with name: \" (and debug) enough as well as others (account/container/object server).","commit_id":"c789d50ec955fe8859c4657efe958513fd499257"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"ee0989a1e0f90c879c3314a47d221b6943fa38ae","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        if not policy:"},{"line_number":65,"context_line":"            self.app.logger.error("},{"line_number":66,"context_line":"                \u0027Could not translate %s (%r) from %r to policy\u0027,"},{"line_number":67,"context_line":"                \u0027X-Storage-Policy\u0027, policy_name, req.path)"},{"line_number":68,"context_line":"            raise HTTPBadRequest(request\u003dreq,"},{"line_number":69,"context_line":"                                 content_type\u003d\"text/plain\","},{"line_number":70,"context_line":"                                 body\u003d(\"Invalid %s \u0027%s\u0027\""}],"source_content_type":"text/x-python","patch_set":9,"id":"9aed3d3a_1928dfe1","line":67,"in_reply_to":"bae84128_8dd99486","updated":"2016-02-27 03:19:38.000000000","message":"Done","commit_id":"c789d50ec955fe8859c4657efe958513fd499257"}],"test/unit/account/test_utils.py":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"424ff6e298b067cd8646d5fcc6496890c0e0f99e","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        ts \u003d (Timestamp(t).internal for t in itertools.count(int(now)))"},{"line_number":204,"context_line":"        invalid_policy \u003d StoragePolicy(2, \u0027two\u0027)"},{"line_number":205,"context_line":"        policy_dict \u003d copy.copy(POLICIES.by_index)"},{"line_number":206,"context_line":"        policy_dict.update({int(invalid_policy): invalid_policy})"},{"line_number":207,"context_line":"        total_containers \u003d 0"},{"line_number":208,"context_line":"        total_objects \u003d 0"},{"line_number":209,"context_line":"        total_bytes \u003d 0"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_f6ce9a2c","line":206,"updated":"2015-06-26 05:36:16.000000000","message":"Actually we don\u0027t need copy module, right? (if you want just a copy list of the values)\n\njust like as:\n\n policies \u003d POLICIES.by_index.values()\n policies.append(invalid_policy)","commit_id":"3da43fa5b3f582cebc22e999d394d972547dd49a"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"b7b80290c7d131466ea76d729f0673b5e469263e","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        ts \u003d (Timestamp(t).internal for t in itertools.count(int(now)))"},{"line_number":204,"context_line":"        invalid_policy \u003d StoragePolicy(2, \u0027two\u0027)"},{"line_number":205,"context_line":"        policy_dict \u003d copy.copy(POLICIES.by_index)"},{"line_number":206,"context_line":"        policy_dict.update({int(invalid_policy): invalid_policy})"},{"line_number":207,"context_line":"        total_containers \u003d 0"},{"line_number":208,"context_line":"        total_objects \u003d 0"},{"line_number":209,"context_line":"        total_bytes \u003d 0"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_20e520a3","line":206,"in_reply_to":"fa32b979_f6ce9a2c","updated":"2015-08-11 15:16:15.000000000","message":"Done","commit_id":"3da43fa5b3f582cebc22e999d394d972547dd49a"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"424ff6e298b067cd8646d5fcc6496890c0e0f99e","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        total_containers \u003d 0"},{"line_number":208,"context_line":"        total_objects \u003d 0"},{"line_number":209,"context_line":"        total_bytes \u003d 0"},{"line_number":210,"context_line":"        for policy in policy_dict.values():"},{"line_number":211,"context_line":"            delete_timestamp \u003d ts.next()"},{"line_number":212,"context_line":"            put_timestamp \u003d ts.next()"},{"line_number":213,"context_line":"            object_count \u003d int(policy)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_d6d6f6c2","line":210,"updated":"2015-06-26 05:36:16.000000000","message":"And then,\n\n for policy in policies:","commit_id":"3da43fa5b3f582cebc22e999d394d972547dd49a"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"b7b80290c7d131466ea76d729f0673b5e469263e","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        total_containers \u003d 0"},{"line_number":208,"context_line":"        total_objects \u003d 0"},{"line_number":209,"context_line":"        total_bytes \u003d 0"},{"line_number":210,"context_line":"        for policy in policy_dict.values():"},{"line_number":211,"context_line":"            delete_timestamp \u003d ts.next()"},{"line_number":212,"context_line":"            put_timestamp \u003d ts.next()"},{"line_number":213,"context_line":"            object_count \u003d int(policy)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_00010438","line":210,"in_reply_to":"fa32b979_d6d6f6c2","updated":"2015-08-11 15:16:15.000000000","message":"Done","commit_id":"3da43fa5b3f582cebc22e999d394d972547dd49a"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"424ff6e298b067cd8646d5fcc6496890c0e0f99e","unresolved":false,"context_lines":[{"line_number":243,"context_line":"        self.assertFalse(expected)"},{"line_number":244,"context_line":"        # Check log and info for invalid policy"},{"line_number":245,"context_line":"        self.assertEqual(broker.logger.log_dict[\u0027error\u0027][0][0],"},{"line_number":246,"context_line":"                         (\u0027No policy with index 2\u0027,))"},{"line_number":247,"context_line":"        for h in unexpected_headers:"},{"line_number":248,"context_line":"            self.assertNotIn(h, resp_headers)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_b62332be","line":246,"updated":"2015-06-26 05:36:16.000000000","message":"Don\u0027t we need the log for translation failure like container controller?","commit_id":"3da43fa5b3f582cebc22e999d394d972547dd49a"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"09d74c0d4bc7be288b74479934f4f98450898c69","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        with mock.patch(\u0027time.time\u0027, new\u003dlambda: now):"},{"line_number":200,"context_line":"            broker.initialize(Timestamp(now).internal)"},{"line_number":201,"context_line":"        # add some container data"},{"line_number":202,"context_line":"        ts \u003d (Timestamp(t).internal for t in itertools.count(int(now)))"},{"line_number":203,"context_line":"        invalid_policy \u003d StoragePolicy(2, \u0027two\u0027)"},{"line_number":204,"context_line":"        policies \u003d POLICIES.by_index.values()"},{"line_number":205,"context_line":"        policies.append(invalid_policy)"}],"source_content_type":"text/x-python","patch_set":9,"id":"bae84128_6de6d0e9","line":202,"updated":"2016-02-25 04:35:55.000000000","message":"How about to use test.unit.make_timestamp_iter instead?","commit_id":"c789d50ec955fe8859c4657efe958513fd499257"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"ee0989a1e0f90c879c3314a47d221b6943fa38ae","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        with mock.patch(\u0027time.time\u0027, new\u003dlambda: now):"},{"line_number":200,"context_line":"            broker.initialize(Timestamp(now).internal)"},{"line_number":201,"context_line":"        # add some container data"},{"line_number":202,"context_line":"        ts \u003d (Timestamp(t).internal for t in itertools.count(int(now)))"},{"line_number":203,"context_line":"        invalid_policy \u003d StoragePolicy(2, \u0027two\u0027)"},{"line_number":204,"context_line":"        policies \u003d POLICIES.by_index.values()"},{"line_number":205,"context_line":"        policies.append(invalid_policy)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aed3d3a_3c1791ee","line":202,"in_reply_to":"bae84128_6de6d0e9","updated":"2016-02-27 03:19:38.000000000","message":"Done","commit_id":"c789d50ec955fe8859c4657efe958513fd499257"}],"test/unit/obj/test_server.py":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"424ff6e298b067cd8646d5fcc6496890c0e0f99e","unresolved":false,"context_lines":[{"line_number":4960,"context_line":"        self.assertEquals(resp.status_int, 200)"},{"line_number":4961,"context_line":"        self.assertEquals(resp.headers[\u0027X-Timestamp\u0027], put_timestamp)"},{"line_number":4962,"context_line":""},{"line_number":4963,"context_line":"    def test_PUT_invalid_policy(self):"},{"line_number":4964,"context_line":"        # PUT with policy index which is not defined in the policy setting"},{"line_number":4965,"context_line":"        timestamp \u003d normalize_timestamp(time())"},{"line_number":4966,"context_line":"        req \u003d Request.blank("}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_f3c78c96","line":4963,"updated":"2015-06-26 05:36:16.000000000","message":"Wait, a bunch of invalid_policy tests seems duplicated another test from L4903. Though test_storage_policy_index_is_validated might be needed to be added more assertion (maybe logger assertions?) according to your intention but I guess we don\u0027t need create new tests around here.","commit_id":"3da43fa5b3f582cebc22e999d394d972547dd49a"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"b7b80290c7d131466ea76d729f0673b5e469263e","unresolved":false,"context_lines":[{"line_number":4960,"context_line":"        self.assertEquals(resp.status_int, 200)"},{"line_number":4961,"context_line":"        self.assertEquals(resp.headers[\u0027X-Timestamp\u0027], put_timestamp)"},{"line_number":4962,"context_line":""},{"line_number":4963,"context_line":"    def test_PUT_invalid_policy(self):"},{"line_number":4964,"context_line":"        # PUT with policy index which is not defined in the policy setting"},{"line_number":4965,"context_line":"        timestamp \u003d normalize_timestamp(time())"},{"line_number":4966,"context_line":"        req \u003d Request.blank("}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_f4c5b98d","line":4963,"in_reply_to":"fa32b979_f3c78c96","updated":"2015-08-11 15:16:15.000000000","message":"Thanks! I did not be aware of it.","commit_id":"3da43fa5b3f582cebc22e999d394d972547dd49a"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"424ff6e298b067cd8646d5fcc6496890c0e0f99e","unresolved":false,"context_lines":[{"line_number":4971,"context_line":"                     \u0027X-Backend-Storage-Policy-Index\u0027: 2})"},{"line_number":4972,"context_line":"        req.body \u003d \u0027VERIFY\u0027"},{"line_number":4973,"context_line":"        resp \u003d req.get_response(self.object_controller)"},{"line_number":4974,"context_line":"        self.assertEquals(resp.status_int, 503)"},{"line_number":4975,"context_line":"        self.assertEqual("},{"line_number":4976,"context_line":"            self.object_controller.logger.log_dict[\u0027error\u0027][0][0],"},{"line_number":4977,"context_line":"            (\u0027No policy with index 2\u0027,))"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_2eca6c1b","line":4974,"updated":"2015-06-26 05:36:16.000000000","message":"(Nits) self.assertEquals(resp.body, \u0027No policy with indx 2\u0027)","commit_id":"3da43fa5b3f582cebc22e999d394d972547dd49a"}]}
